chore: 🛂 Add context variables to support typebot
This commit is contained in:
@ -1,8 +1,12 @@
|
||||
import { useTypebot } from 'contexts/TypebotContext'
|
||||
import { useUser } from 'contexts/UserContext'
|
||||
import { useRouter } from 'next/router'
|
||||
import React, { useEffect } from 'react'
|
||||
import { initBubble } from 'typebot-js'
|
||||
|
||||
export const SupportBubble = () => {
|
||||
const { typebot } = useTypebot()
|
||||
const { user } = useUser()
|
||||
const router = useRouter()
|
||||
|
||||
useEffect(() => {
|
||||
@ -11,6 +15,12 @@ export const SupportBubble = () => {
|
||||
viewerHost: process.env.NEXT_PUBLIC_VIEWER_HOST,
|
||||
backgroundColor: '#ffffff',
|
||||
button: { color: '#0042DA' },
|
||||
hiddenVariables: {
|
||||
'Current URL': window.location.href,
|
||||
'User ID': user?.id,
|
||||
Email: user?.email ?? undefined,
|
||||
'Typebot ID': typebot?.id,
|
||||
},
|
||||
})
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [router])
|
||||
|
Reference in New Issue
Block a user