Chat build with React and Chatkit that uses a Node.js server to post messages. However, users can only post messages after signing a document using Docusign API. Follow the tutorial here.
- Clone this repository.
- Create a Chatkit instance if you haven't already.
- In the Chatkit dashboard of your instance, in the Instance Inspector section, create one or two users and one chat room.
- Follow this guide to:
- Sign up for a Docusign developer sandbox.
- Create an integrator key with a Redirect URI and RSA keypair (this will be your only chance to save these keys)
- Add a template using the document you find in this repo (
nda.pdf) or your own.
- Grant access to your integration key by visiting this URL (replace your integration key and redirect URI):
https://account-d.docusign.com/oauth/auth? response_type=code&scope=signature%20impersonation&client_id=INTEGRATION_KEY&redirect_uri=REDIRECT_URI. - In the file
src/App.jsenter:
- Your Chatkit instance locator, something like
v1:us1:xxxxxxxxxxxxxxxx
- In the file
src/ChatScreen.jsenter:
- Your Chatkit room ID
- In the file
server.jsenter:
- From Docusign:
- Your Integrator Key
- Your username API
- Your template ID and role
- A subdomain for the public URL of your server (that will be configured using localtunnel)
- From Chatkit:
- Your Chatkit instance locator, something like
v1:us1:xxxxxxxxxxxxxxxx - Your Chatkit secret key, something like
0710e105-5f59-20765:rPejy0yUx3VzI=
- Your Chatkit instance locator, something like
- One or two users's IDs and emails. The ID must match the one registered in Chatkit. In that email the user will receive the document from Docusign.
- Create a directory
keysand inside of it, the filedocusign_private_key.txtand paste the RSA private key from your integrator key. - In a terminal window, execute
npm installto install the dependencies of the app. - Execute the server and the chat app with
npm start. - In another terminal window, install localtunnel with
npm install -g localtunneland executelt --subdomain YOUR_SUBDOMAIN --port 3001to expose your local server to the world so Docusign can call your webhook (the subdomain must match the one entered inserver.js). - Enter the username in the first screen of the app to enter the chat.
- Try sending a message. You won't be able to do it.
- Click on the button
Send NDAto receive the document in the user's email and sign it. - Monitor the server console to know when the webhook was called with the completion event.
- From that moment, the user will be able to send messages.
- Optionally, open the app in another browser to log in as another user, sign the document, and start chatting.
- Pusher Chatkit - Developer-driven chat done simply
- Docusign - eSignature solutions
- React.js - A JavaScript library for building interfaces
- Node.js - A JavaScript runtime built on Chrome's V8 JavaScript engine
- Thanks to Pusher for sponsoring this tutorial.
MIT