Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Apr 23, 2024. It is now read-only.

Commit 69c4e6b

Browse files
authored
Merge pull request #22 from AdaSupport/SA/sensitive-meta-fields
Add docs for `sensitiveMetaFields`
2 parents 014df9a + 9e050ac commit 69c4e6b

File tree

1 file changed

+31
-3
lines changed

1 file changed

+31
-3
lines changed

source/includes/_embed2.md.erb

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,14 +263,30 @@ Takes in a language code to programatically set the bot language. Languages must
263263
</script>
264264
```
265265

266-
`metaFields?: object;`
266+
`metaFields?: { [key: string]: string|number|boolean|null };`
267267

268268
Used to pass meta information about a `chatter`. This can be useful for tracking information about your end users, as well as for personalizing their experience. For example, you may wish to track the `phone_number` and `name` for conversation attribution. Once set, this information can be accessed in the email attachment from Handoff Form submissions, or via the *Chatter Info* modal in the *Conversations* page of your Ada dashboard. Should you need to programatically change these values after bot setup, you can make use of the `setMetaFields` action below.
269269

270270
<aside class="notice">
271271
Meta field keys should not include whitespace, emojis, special characters or periods.
272272
</aside>
273273

274+
#### sensitiveMetaFields
275+
276+
```html
277+
<script type="text/javascript">
278+
window.adaSettings = {
279+
sensitiveMetaFields: {
280+
jwt_token: "xxxxx.yyyyy.zzzzz",
281+
}
282+
}
283+
</script>
284+
```
285+
286+
`sensitiveMetaFields?: { [key: string]: string|number|boolean|null };`
287+
288+
Similar to `metaFields` except the values are not stored in the database and will be deleted after 24 hours.
289+
274290
#### lazy
275291
`lazy?: boolean;`
276292

@@ -406,7 +422,7 @@ window.adaEmbed.reset({
406422

407423
`reset(resetParams?: ResetParams): Promise<void>;`
408424

409-
Creates a new `chatter` and refreshes the Chat window. `reset` can take an optional object allowing `language`, `metaFields`, and `greeting` to be changed for the new `chatter`.
425+
Creates a new `chatter` and refreshes the Chat window. `reset` can take an optional object allowing `language`, `metaFields`, `sensitiveMetaFields`, and `greeting` to be changed for the new `chatter`.
410426

411427
To prevent creating a new `chatter` (and maintain conversation history), `resetChatHistory` can be passed to the object with a value of `false`.
412428

@@ -419,14 +435,26 @@ window.adaEmbed.setMetaFields({
419435
});
420436
```
421437

422-
`setMetaFields(options: object): Promise<void>;`
438+
`setMetaFields(fields: { [key: string]: string|number|boolean|null }): Promise<void>;`
423439

424440
Used to update `metaFields` after Chat has been opened. In most situations, the `metaFields` settings object should be enough for user attribution. However, in cases where Ada Chat remains open while page changes occur (like in Single Page Applications), this methods may be useful.
425441

426442
<aside class="notice">
427443
Meta field keys should not include whitespace, emojis, special characters or periods.
428444
</aside>
429445

446+
#### setSensitiveMetaFields
447+
448+
```js
449+
window.adaEmbed.setSensitiveMetaFields({
450+
jwt_token: "xxxxx.yyyyy.zzzzz",
451+
});
452+
```
453+
454+
`setSensitiveMetaFields(fields: { [key: string]: string|number|boolean|null }): Promise<void>;`
455+
456+
Same as `setMetaFields` except the values are not stored in the database and will be deleted after 24 hours.
457+
430458
#### start
431459

432460
```js

0 commit comments

Comments
 (0)