Context
Context is a set of key and value pairs that your app attaches to what the user sends, for the bot to use
Set context
KindlyWebViewSDK.setNewContext(["plan": "gold"])The context goes with the next message, button click or triggered dialogue, and is delivered once. With a chat page loaded it reaches the chat at once, and the chat merges it with context it already holds, so two calls before the next message send both maps. Without a loaded page the SDK keeps only the latest map and delivers it to the next page
Keys and values are strings. A map can hold up to 100 entries, with keys of 1 to 256 characters and values of up to 4,096 characters, and a key cannot be __proto__, constructor or prototype. The SDK refuses a map that breaks these rules with an error in the log. Flutter checks the three reserved keys before the call and throws an ArgumentError, and React Native throws a KindlyWebViewError with the code INVALID_ARGUMENT for them and for a value that is not a string
Clear context
KindlyWebViewSDK.clearNewContext()This withdraws the context set with setNewContext, including context the chat page already received
Context for one message
To attach context to a single message instead, pass it with the message, see Send a Message