An example integration for Clarity Hub using Node.JS
This example goes over creating an integration, using Oauth, setting up callbacks, and using the Clarity Hub npm package.
- Go to the Developers Site.
- Sign in and create an integration. Give it the name "Hoot Bot"
- Run ngrok
ngrok http 3000and grab thehttpsforwarding port. In our case, it ishttps://c7faee32.ngrok.io - In the Developers panel, grab your Client Id, Client Secret, and Verification token and run:
$ CLIENT_ID=XXX CLIENT_SECRET=XXX TOKEN=XXX PORT=3000 yarn start - In the Developers panel, set your Callback Url to
https://c7faee32.ngrok.io/callbackand select thechat-message.createdevent. You should see success. - In the Developers panel, set your Redirect URI to
https://c7faee32.ngrok.io/oauth. You should see success.
Let's test the integration!
- Go to
https://app.clarityhub.io/oauth/authorize?clientId=XXX - Click "Reactivate"
- You should see "Successfully activated!"
- Try it out. Create a chat as a client, join the room on the agent's end and then send the word "hoot" as the client. The integration should respond with a picture of an owl!