0.2.81 • Published 14 days ago

@typebot.io/react v0.2.81

Weekly downloads
-
License
ISC
Repository
-
Last release
14 days ago

Install

npm install @typebot.io/js @typebot.io/react

Standard

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

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:

import { open } from '@typebot.io/react'

open()
import { close } from '@typebot.io/react'

close()
import { toggle } from '@typebot.io/react'

toggle()

Bubble

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://avatars.githubusercontent.com/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:

import { showPreviewMessage } from '@typebot.io/react'

Typebot.showPreviewMessage()
import { hidePreviewMessage } from '@typebot.io/react'

Typebot.hidePreviewMessage()

Open or close the chat window

You can use these commands:

import { open } from '@typebot.io/react'

open()
import { close } from '@typebot.io/react'

close()
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:

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.

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.

0.2.81

14 days ago

0.2.80

14 days ago

0.2.79

15 days ago

0.2.78

15 days ago

0.2.77

16 days ago

0.2.76

21 days ago

0.2.75

21 days ago

0.2.74

22 days ago

0.2.73

24 days ago

0.2.72

27 days ago

0.2.71

27 days ago

0.2.70

27 days ago

0.2.69

28 days ago

0.2.68

28 days ago

0.2.67

28 days ago

0.2.66

28 days ago

0.2.65

29 days ago

0.2.64

1 month ago

0.2.63

1 month ago

0.2.62

1 month ago

0.2.61

1 month ago

0.2.60

1 month ago

0.2.59

1 month ago

0.2.58

1 month ago

0.2.57

1 month ago

0.2.56

2 months ago

0.2.55

2 months ago

0.2.54

2 months ago

0.2.53

2 months ago

0.2.52

2 months ago

0.2.51

2 months ago

0.2.50

2 months ago

0.2.49

2 months ago

0.2.48

2 months ago

0.2.47

2 months ago

0.2.46

2 months ago

0.2.45

2 months ago

0.2.44

2 months ago

0.2.43

3 months ago

0.2.42

3 months ago

0.2.41

3 months ago

0.2.40

3 months ago

0.2.39

3 months ago

0.2.38

3 months ago

0.2.37

3 months ago

0.2.36

4 months ago

0.2.35

4 months ago

0.2.34

4 months ago

0.2.33

4 months ago

0.2.32

4 months ago

0.2.30

5 months ago

0.2.31

5 months ago

0.2.29

5 months ago

0.2.27

5 months ago

0.2.28

5 months ago

0.2.26

5 months ago

0.2.25

5 months ago

0.2.24

5 months ago

0.2.23

6 months ago

0.0.80

10 months ago

0.2.22

6 months ago

0.2.21

6 months ago

0.2.20

6 months ago

0.2.19

6 months ago

0.2.17

6 months ago

0.0.73

10 months ago

0.0.74

10 months ago

0.0.75

10 months ago

0.0.76

10 months ago

0.0.77

10 months ago

0.0.78

10 months ago

0.0.79

10 months ago

0.2.16

6 months ago

0.2.15

6 months ago

0.2.14

6 months ago

0.2.13

6 months ago

0.2.12

6 months ago

0.2.11

6 months ago

0.0.70

10 months ago

0.2.10

7 months ago

0.0.71

10 months ago

0.0.72

10 months ago

0.1.30

8 months ago

0.1.31

8 months ago

0.1.32

7 months ago

0.1.33

7 months ago

0.1.34

7 months ago

0.0.66

10 months ago

0.0.67

10 months ago

0.0.68

10 months ago

0.0.69

10 months ago

0.1.27

8 months ago

0.1.28

8 months ago

0.1.29

8 months ago

0.1.20

8 months ago

0.1.21

8 months ago

0.1.22

8 months ago

0.1.23

8 months ago

0.1.24

8 months ago

0.1.25

8 months ago

0.1.26

8 months ago

0.1.16

9 months ago

0.1.17

9 months ago

0.1.18

9 months ago

0.1.19

8 months ago

0.1.10

10 months ago

0.1.11

10 months ago

0.1.12

9 months ago

0.1.13

9 months ago

0.1.14

9 months ago

0.1.15

9 months ago

0.1.0

10 months ago

0.1.2

10 months ago

0.1.1

10 months ago

0.1.8

10 months ago

0.1.7

10 months ago

0.1.9

10 months ago

0.1.4

10 months ago

0.1.3

10 months ago

0.1.6

10 months ago

0.1.5

10 months ago

0.2.1

7 months ago

0.2.0

7 months ago

0.2.7

7 months ago

0.2.6

7 months ago

0.2.9

7 months ago

0.2.8

7 months ago

0.2.3

7 months ago

0.2.2

7 months ago

0.2.5

7 months ago

0.2.4

7 months ago

0.0.63

11 months ago

0.0.64

11 months ago

0.0.65

11 months ago

0.0.45

1 year ago

0.0.46

1 year ago

0.0.47

1 year ago

0.0.62

11 months ago

0.0.60

11 months ago

0.0.61

11 months ago

0.0.59

12 months ago

0.0.51

12 months ago

0.0.52

12 months ago

0.0.53

12 months ago

0.0.54

12 months ago

0.0.55

12 months ago

0.0.56

12 months ago

0.0.57

12 months ago

0.0.50

12 months ago

0.0.48

12 months ago

0.0.49

12 months ago

0.0.40

1 year ago

0.0.41

1 year ago

0.0.42

1 year ago

0.0.43

1 year ago

0.0.44

1 year ago

0.0.37

1 year ago

0.0.38

1 year ago

0.0.39

1 year ago

0.0.21

1 year ago

0.0.22

1 year ago

0.0.23

1 year ago

0.0.24

1 year ago

0.0.25

1 year ago

0.0.30

1 year ago

0.0.31

1 year ago

0.0.32

1 year ago

0.0.33

1 year ago

0.0.34

1 year ago

0.0.35

1 year ago

0.0.36

1 year ago

0.0.26

1 year ago

0.0.27

1 year ago

0.0.28

1 year ago

0.0.29

1 year ago

0.0.20

1 year ago

0.0.19

1 year ago

0.0.18

1 year ago

0.0.17

1 year ago

0.0.16

1 year ago

0.0.15

1 year ago

0.0.14

1 year ago

0.0.13

1 year ago

0.0.12

1 year ago

0.0.11

1 year ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago