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 🙏

© 2025 – Pkg Stats / Ryan Hefner

react-native-dfcx

v0.1.17

Published

A react native implementation for Dialogflow CX

Readme

React Native DFCX Component

A customizable React Native chat interface for Dialogflow CX agents

This React Native component provides a chat interface that communicates securely with a Dialogflow CX agent via a Google Cloud Function middleware proxy. It supports a wide range of Dialogflow Messenger response types and is designed to drop easily into any mobile app using React Native.

🔧 Note: You must deploy the required Cloud Function Middleware in your Google Cloud project before using this component.


Supported Dialogflow Response Types

The component supports the following standard Dialogflow response types in your conversation flows, as detailed in Google’s documentation: Dialogflow Messenger Fulfillment:

  • Text: Simple text responses

  • Description: Multi-line text with a header and body

  • Info: Image with a title, body text, and optional URL

  • Image: Direct image display

  • Video: Embedded video via URL

  • Button: Interactive buttons

    • Each button can include a label (text) and an optional URL.
    • Icons are not supported at this time — only plain text labels are shown.
    • If a URL is provided, tapping the button will open the URL in a browser.
    • If no URL is provided, tapping the button will send the button’s label as a new user message to the Dialogflow agent.
  • List: Scrollable lists of items with titles, subtitles, and images

  • Files: Downloadable file attachments with name and preview

  • Chips: Quick reply suggestions

    • Each chip can include a label (text) and an optional URL.
    • If a URL is provided, tapping the chip will open the URL in a browser.
    • If no URL is provided, tapping the chip will send the chip label as a new user message to the Dialogflow agent.
  • Accordion: Expandable content blocks

NOTE This component requires the chat Cloud Function to be deployed in the same Google Cloud project as your Dialogflow CX agent.

Installation

npm install react-native-dfcx

Basic Usage

import { ChatDialog } from 'react-native-dfcx';

<ChatDialog
  chatURL="https://europe-west1-dotstorming.cloudfunctions.net/cx-chat"
  apiKey="cb2be986-6b84-4ab1-8eeb-b2fc40402077"
  agentPath="https://dialogflow.cloud.google.com/cx/projects/dotstorming/locations/global/agents/4459aa96-eebe-4419-8d28-77207f442165"
  sessionTimeout={30}
  mainColor="#ff0000"
  mainTextColor="#FFFFFF"
  sessionVariables={{
    userId: '12345',
    userName: 'John Doe',
  }}
/>;

Props

| Name | Type | Required | Default | Description | | ------------------ | ------ | -------- | -------------- | ---------------------------------------------------------------------- | | chatURL | string | ✅ | — | The URL of your deployed Dialogflow CX chat function. | | apiKey | string | ❌ | — | Optional API key required to call the chat function. | | agentPath | string | ✅ | — | The full Dialogflow Agent path URL. | | languageCode | string | ❌ | 'en' | Language code of the Dialogflow CX agent. | | sessionTimeout | number | ❌ | 30 | Time in minutes before session resets and new session ID is generated. | | placeholder | string | ❌ | 'Message...' | Input placeholder text. | | startMessage | string | ❌ | — | Hidden message sent to Dialogflow when session starts. | | welcomeMessage | string | ❌ | — | Message shown to user at session start (not sent to Dialogflow). | | mainColor | string | ✅ | — | Background color for user messages. | | mainTextColor | string | ✅ | — | Color for user input text. | | sessionVariables | object | ❌ | {} | Parameters sent with each user input. |

Methods

| Name | Description | | --------- | ------------------------------------------------ | | restart | Restarts the chat session with a new session ID. |

Retrieving your Agent Path

To find your agent path:

  1. Go to the Dialogflow CX Console.
  2. Open your project and view the list of agents.
  3. Click the clipboard icon next to your agent to copy its path.

The copied URL can be pasted directly into the agentPath prop.

Need Help?

For help or customizations, reach out to [email protected].