souvik666 / bot-sdk

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bot SDK Usage Guide

This guide explains how to inject text to the context

Steps

Step Description Action
1 Click on configuration Step 1
2 Add your desired custom keys Step 2
3 Inject context using sendUserInfo Use the sendUserInfo method from the BotSdk class to send user information and additional properties to the context.

Bot SDK Response

After using the sendUserInfo method (by emitting an event with window.postMessage(message, "*")) from the BotSdk class, you can expect a response in the following format:

| Property       | Description                  |
|----------------|------------------------------|
| userName       | The user's name.             |
| userEmail      | The user's email.            |
| customProperty | Custom property's value.     |
| ...            | Other additional properties. |

Example

const sdk = new BotSdk()

sdk.event.sendUserInfo({
name:"foo",
email:"faa@fpp.com",
//** adtional info that we want to pass
company:"CLIBRAIN"
})

About


Languages

Language:TypeScript 100.0%