Skip to content

Commit

Permalink
chat-headless: add support for session reinitialization (#59)
Browse files Browse the repository at this point in the history
Adds session state management for the credentials returned by the underlying
agent client, such that on agent client initialization, the returned credentials
are saved in session storage. When chat-headless is reloaded and getNextMessage
is called, the session in the agent client is reinitialized.

Session credentials are cleared any time the client is reset.

TEST=manual,auto

Wrote new unit tests, saw them pass.

Ran local test app with a Zendesk client, saw conversation persisted
across page refreshes.
  • Loading branch information
popestr authored Oct 2, 2024
1 parent a3b3581 commit ff7d174
Show file tree
Hide file tree
Showing 15 changed files with 333 additions and 704 deletions.
38 changes: 36 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions packages/chat-headless-react/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,38 @@
## Testing Process

### Unit Testing

We use Jest as our framework for unit tests. Execute the unit tests with the following command:

```
npm run test
```

### Test Site

To facilitate manual verification, a React test site has been set up in `apps/test-site`. This site currently already have an App component that interfaces with the local `chat-headless-react` library.

To set up the test site, make sure you have a `.env` file configured following the `.sample.env` file. Then, run the following commands:

```
npm i
npm run start
```


## Build Process

Before initiating the build, run the linting process to identify and address any errors or warnings. Use the following command:

```
npm run lint
```

To build the library, execute:

```
npm run build
```

This will create the bundle in the `/dist` directory. This command will also generate documentation files and the `THIRD-PARTY-NOTICES` file.

For guidelines on pull request and version publish process, visit Chat SDK wiki page.
For guidelines on pull request and version publish process, visit Chat SDK wiki page.
Loading

0 comments on commit ff7d174

Please sign in to comment.