Skip to content

xavidop/dialogflow-cx-messenger-ts

Typescript Types for Dialogflow CX Messenger Integration

CI status   Stats on npm   Docs

Typescript classes and types to use Dialogflow Messenger Integration in Typescript. Please check the Official Dialogflow CX Messenger Integration documentation for more information.

Installation

To install:

npm install dialogflow-cx-messenger-ts

or

yarn add dialogflow-cx-messenger-ts

Usage

Once installed, you can import the types and use them in your code:

import * as dfcxmessenger from 'dialogflow-cx-messenger-ts';

Then you can use it to create a response:

  const response = {};

  const content = new dfcxmessenger.RichContent();
  const richContentElement = new dfcxmessenger.RichContentElement();
  richContentElement.type = "image";
  richContentElement.rawUrl = "https://example.com/images/logo.png";
  richContentElement.accessibilityText = "Example logo";
  content.richContent = [[richContentElement]];

  response.fulfillmentResponse = {
    messages: [{
      text: {
        text: [
          information,
        ],
      },
    },
    {
      payload: content,
    }],
  };

Documentation

You can find the documentation here.

Example

You can find an example here

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Please make sure that read the Contributing file.

Sponsors

Does your company use this package? Help keep the project bug-free and feature rich by sponsoring the project.

Contributors

This project exists thanks to all the people who contribute. Check our contributing guidelines. Check all contributors here.

Stargazers over time

Stargazers over time

License

FOSSA Status