This service listens for user messages from Sunshine Conversations and responds with a button triggering a webview. The webview acts as a multi-page form, which when submitted makes a call to the backend of this service containing the data submitted by the user. The backend then calls Sunshine Conversations to echo the selection into the conversation as a user message.
These examples are built with node.js and express.
- run
git clone https://github.com/zendesk/sunshine-conversations-conversation-extension-examples.git
- run
npm install
- expose the port you're running this service on to the web (e.g. using a service like ngrok.io)
- create a .env file with the credentials necessary to run this service using the .env.example as a guide
- run
npm start
to run the server - configure a V2 webhook for Conversation message events at
https://app.smooch.io/apps/APP_ID/webhooks
to point towards the ngrok/other link exposing the port being used at the route/api/webhooks
- open your browser to localhost:8000 or whichever port you specified in the .env file
- click the "Add Messenger" button
- check out the intents.js file to see what text can be used to trigger a conversation-extension button
To learn more about conversation extensions see the Guide, where you can also follow along with an example written in React.