How to set Session Variables?

How to set Session Variables for React Native SDK?

What are session variables?

Guided Conversations

These variables are dynamically retrieved during the bot conversations. These variables are org-specific and accessible across GC flows.
You can perform these actions with the session variable as mentioned below.

Set Session Variable of Guided Conversations:

To pass the values for the session variables configured with GC Flow/Widget, use the following method:
  1. import {ZohoDeskPortalChatKit} from '@zohocorp/zohodesk-portal-chatkit';
  2. //To pass an array of dictionary
  3. ZohoDeskPortalChatKit.setGCSessionVariable([{variableName: value},{variableName: value}])

Update Session Variable of Guided Conversations:

To update the values for the session variables configured with GC Flow/Widget, use the following method:
  1. import {ZohoDeskPortalChatKit} from '@zohocorp/zohodesk-portal-chatkit';
  2. //To pass an array of dictionary
  3. ZohoDeskPortalChatKit.updateGCSessionVariable([{variableName: value},{variableName: value}])

Business Messaging

These variables are dynamically retrieved during the bot conversations. These variables are org-specific and accessible across IM channels.
You can perform these actions with the session variable as mentioned:

Set Session Variable of Business Messaging:

To pass the values for the session variables configured with the BM Channel, use the following method:
  1. import {ZohoDeskPortalChatKit} from '@zohocorp/zohodesk-portal-chatkit';
  2. ZohoDeskPortalChatKit.setBMSessionVariable([{variableName: value},{variableName: value}])

Update Session Variable of Business Messaging:

To update the values for the session variables configured with the BM Channel, use the following method:
  1. import {ZohoDeskPortalChatKit} from '@zohocorp/zohodesk-portal-chatkit';
  2. ZohoDeskPortalChatKit.updateBMSessionVariable([{variableName: value},{variableName: value}])