DigitalCX's ready-to-go integration between DigitalCX and the Google Assistant. This project requires you to set up an Actions project through the Google Action SDK. This project provides you with the web hook logic that you can expose on top of your pre-existing Express.js server.
const express = require('express')
const googleAssistant = require('dcx-google-assistant')
const app = express()
app.use('/googleassistant', googleAssistant({
dcx: {
customerKey: 'customer key',
projectKey: 'project key',
culture: 'culture',
apiKey: 'api key',
env: 'cms|staging|production'
},
onload: 'google-assistant-onload'
}))
app.listen(3000)
This is a Node.js module available through the npm registry.
Before installing, download and install Node.js. This module was developed using Node.js v8.12.0.
Installation is done using the npm install command:
npm i dcx-google-assistant
This module has been set up using the actions-on-google SDK.
- Hooks into any Express.js server as Express middleware.
- Offers full support for Q&A's, events, dialogs and transactional dialogs.
- Each instance can be configured to integrate with a single customer-project-culture combination.
- Multiple instances can easily be created
The DigitalCX Google Assistant integration offers a number of configuration options, some of them required and some of them optional. All configuration options need to be passed along wrapped in a single object and presented as the first parameter:
Parameter Name | Type | Description | Required | Example |
---|---|---|---|---|
dcx | object | An object containing the information required to connect and authenticate your application with and to the DigitalCX engine. | yes | { "customerKey":"ckey", "projectKey":"pkey", "culture":"en", "apiKey":"api key", "env":"production" } |
onload | string | A string representing the event you'd like the Google Assistant to trigger and welcome the end user with. | yes | dcx-google-assistant-onload |
dialogOptionsQuery | array | An array of string values that will be (randomly) cycled through when a dialog or transactional dialog contains dialog options or quick replies. | no | [ "We have several pre defined options available to you:", "Please choose one of the following replies:" ] |
To run the test suite, first install the dependencies, then run npm test:
npm i
npm test