This is an example JWT server, built for the Zendesk messaging web SDK. It demonstrates the behavior of an authenticated messaging experience for your end-users, while also allowing you to contrast it with an unauthenticated session. It is NOT intended for production use.
For more information on how to enable authenticated visitors in your Zendesk instance, take a look at our documentation on the subject.
For a quick demo, there is a built-in user database of users with first and last name, email, and password. You can use the below credentials to log in to a test instance of Zendesk and initiate a conversation. Note that no agents will be responding, but you will be able to see the bot interaction.
- email address: [email protected] || [email protected] || [email protected]
- password: password123
The .env file contains private data that will not be visible to you. Once you Remix the project (see below), you will see the .env file, but the values will be scrubbed and you will be able to enter your own details.
This project uses Node and Express.js for the backend, and vanilla-ish JS and HTML for the frontend. Styling utilizes Tailwind CSS.
There are also two cookies added on login to handle the state changes of the login form. They are removed on logout.
- Open a terminal window and add the node packages with
npm install
- Navigate to the .env file and enter the key ID and shared secret for your widget. See here for information on obtaining these values.
- Navigate to src/index.html and replace the widget key snippet with your own. See here for instructions on obtaining the key snippet.
- Go back to your terminal and enter
npm run start
- Go to http://localhost:3000/ (or whatever port number you specified in .env)
- That's it, you're all set to go! You can now log in with one of the credentials listed above and start playing around with the authenticated experience. You can also choose the anonymous chat (which is only available)
If you run into any issues or have suggestions, please submit an issue.
List of contributors:
- Greg Katechis | Dev Advocacy @ Zendesk
- Tipene Hughes | Dev Advocacy @ Zendesk
MIT license