Skip to content

Commit

Permalink
docs: 📝 Add hiddenVariables JS instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Mar 28, 2022
1 parent 60dcd5c commit 38c39d4
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions apps/docs/docs/editor/variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@ Let's say I have a variable named "Email" somewhere in my bot. If I'm launching

Then if an input step is saving the answer into this variable, it will be first prefilled with this initial value. It can greatly improve the user experience if you already have data about him.

Prefilling variables using the embed library is even easier. You need to add an object named `hiddenVariables` that contains a dictionary of your values. For example:

```js
Typebot.initBubble({
url: `https://viewer.typebot.io/typebot-support`,
hiddenVariables: {
'User ID': '123',
'First name': 'John',
Email: 'test@test.com',
},
})
```

### Hidden variables

These are simply variables that are declared in the bot flow but aren't displayed to the user anywhere. This allows you to add some context to a session for example a User ID, a `utm_source` parameter (in the case of a marketing campaign), or anything else.
Expand Down

3 comments on commit 38c39d4

@vercel
Copy link

@vercel vercel bot commented on 38c39d4 Mar 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 38c39d4 Mar 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 38c39d4 Mar 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

docs – ./apps/docs

docs-typebot-io.vercel.app
docs-git-main-typebot-io.vercel.app
docs.typebot.io

Please sign in to comment.