
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
actions-on-google
Advanced tools
This client library makes it easy to create Actions for the Google Assistant and supports Dialogflow, Actions SDK, and Smart Home fulfillment.
Install the library with either npm install actions-on-google
or yarn add actions-on-google
if you use yarn.
// Import the appropriate service and chosen wrappers
const {
dialogflow,
Image,
} = require('actions-on-google')
// Create an app instance
const app = dialogflow()
// Register handlers for Dialogflow intents
app.intent('Default Welcome Intent', conv => {
conv.ask('Hi, how is it going?')
conv.ask(`Here's a picture of a cat`)
conv.ask(new Image({
url: 'https://developers.google.com/web/fundamentals/accessibility/semantics-builtin/imgs/160204193356-01-cat-500.jpg',
alt: 'A cat',
}))
})
// Intent in Dialogflow called `Goodbye`
app.intent('Goodbye', conv => {
conv.close('See you later!')
})
app.intent('Default Fallback Intent', conv => {
conv.ask(`I didn't understand. Can you tell me something else?`)
})
// Import the appropriate service and chosen wrappers
const {
actionssdk,
Image,
} = require('actions-on-google')
// Create an app instance
const app = actionssdk()
// Register handlers for Actions SDK intents
app.intent('actions.intent.MAIN', conv => {
conv.ask('Hi, how is it going?')
conv.ask(`Here's a picture of a cat`)
conv.ask(new Image({
url: 'https://developers.google.com/web/fundamentals/accessibility/semantics-builtin/imgs/160204193356-01-cat-500.jpg',
alt: 'A cat',
}))
})
app.intent('actions.intent.TEXT', (conv, input) => {
if (input === 'bye' || input === 'goodbye') {
return conv.close('See you later!')
}
conv.ask(`I didn't understand. Can you tell me something else?`)
})
// Import the appropriate service
const { smarthome } = require('actions-on-google')
// Create an app instance
const app = smarthome()
// Register handlers for Smart Home intents
app.onExecute((body, headers) => {
return {
requestId: 'ff36...',
payload: {
// ...
},
}
})
app.onQuery((body, headers) => {
return {
requestId: 'ff36...',
payload: {
// ...
},
}
})
app.onSync((body, headers) => {
return {
requestId: 'ff36...',
payload: {
// ...
},
}
})
Export or run for your appropriate framework:
const functions = require('firebase-functions')
// ... app code here
exports.fulfillment = functions.https.onRequest(app)
const functions = require('firebase-functions')
// ... app code here
// name has to be `dialogflowFirebaseFulfillment`
exports.dialogflowFirebaseFulfillment = functions.https.onRequest(app)
const express = require('express')
const bodyParser = require('body-parser')
// ... app code here
const expressApp = express().use(bodyParser.json())
expressApp.post('/fulfillment', app)
expressApp.listen(3000)
// ... app code here
exports.fulfillment = app
Take a look at the docs and samples linked at the top to get to know the platform and supported functionalities.
This library uses yarn
to run commands. Install yarn using instructions from https://yarnpkg.com/en/docs/install or with npm: npm i -g yarn
.
Install the library dependencies with yarn
. If you want to run any of the sample apps, follow the instructions in the sample README.
Public interfaces, classes, functions, objects, and properties are labeled with the JSDoc @public
tag and exported at the top level. Everything else that is not labeled @public
and exported at the top level is considered internal and may be changed.
This library supports the following Services:
This library supports only Actions SDK fulfillment version 2.
To ensure that your fulfillment uses version 2, set the "fulfillmentApiVersion": 2
property in your action package.
Please read and follow the steps in the CONTRIBUTING.md.
See LICENSE.md.
Your use of this library is subject to, and by using or downloading the sample files you agree to comply with, the Google APIs Terms of Service.
Actions on Google Developers Community on Google+ https://g.co/actionsdev.
[2.3.0] - 2018-08-03
FAQs
Actions on Google Client Library for Node.js
The npm package actions-on-google receives a total of 5,148 weekly downloads. As such, actions-on-google popularity was classified as popular.
We found that actions-on-google demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.