npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

dialogflow-nexmo

v1.0.1

Published

A bridge between the Nexmo Messaging API and Google Dialogflow.

Downloads

10

Readme

dialogflow-nexmo

A bridge between the Nexmo Messaging API and Google Dialogflow.

How it works

This middleware relies on both Nexmo and Dialogflow SDKs. Inbound text messages sent to provisioned Nexmo number are handled through a webhook which forwards it to Dialogflow API.

Responses from Dialogflow go through a text normalization phase to remove unsupported characters and are sent back to the origination number. Multiple response messages are throttled to minimize delivery error rate.

Getting Started

Requirements

Nexmo

Nexmo integration requires a Nexmo account with a provisioned SMS DID/Number. You also need to configure the webhook endpoint from your Nexmo account. Please refer to the Nexmo documentation for more information.

Dialogflow

Dialogflow integration requires a Dialogflow (and/or Google Cloud Platform) account along with a project Id (mapping to an actual Dialogflow project).

Usage

Require the dialogflowNexmo middleware. Then simply call the dialogflowNexmo.connect(message, origination, options) function, where

  • message is either a string or an array of strings containing the user input;
  • origination is the phone number used to call the service;
  • and options is an object holding all the Dialogflow and Nexmo configuration (see next section for more information on that subject).

The function returns a Promise.

Configuration

This is a list of the configurations expected by the middleware. Keys with a default value are optional.

| Key | Description | Default | | ----------------------- | --------------------------------------------------------------------- | ------- | | dialogflow.projectId | Dialogflow Project Id | - | | dialogflow.languageCode | Dialogflow Project Language | en-US | | dialogflow.env | Dialogflow Project Environment. When specified, will use the Beta API | - | | nexmo.apiKey | Nexmo API Key | - | | nexmo.apiSecret | Nexmo API Secret | - | | nexmo.did | Nexmo Number | - | | nexmo.throttling | Nexmo message throttling in ms. | 500 |

Integration

Please consult the files in the example folder for integration examples.

Note: for the moment, we only support deploying on a Google Cloud Function in the same account as your Dialogflow account. We plan on supporting a wider range of options in the close future.

Test

yarn install
yarn run test --silent

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Support

You can reach the dialogflow-nexmo team by email at [email protected]

License

This project is licensed under the Apache License, Version 2.0 - see the LICENSE file for details