vc i chatbase/chatbotAI agents for support & sales
Chatbase is a platform for building AI agents trained on your own data: your website, docs, files and help center. Over 10,000 businesses in 140+ countries use it.
Embed a Widget on your Vercel site, or connect WhatsApp, Instagram, Messenger, Slack, email and phone.
Start by connecting to your existing project and then run vercel link in the CLI to link to the project locally.
Run vercel env pull to make the latest environment variables available to your project locally.
Add this snippet to your jsx component
<Script>
{
`(function(){if(!window.chatbase||window.chatbase("getState")!=="initialized"){window.chatbase=(...arguments)=>{if(!window.chatbase.q){window.chatbase.q=[]}window.chatbase.q.push(arguments)};window.chatbase=new Proxy(window.chatbase,{get(target,prop){if(prop==="q"){return target.q}return(...args)=>target(prop,...args)}})}const onLoad=function(){const script=document.createElement("script");script.src="www.chatbase.co/embed.min.js";script.id="${
process.env.NEXT_PUBLIC_CHATBOT_ID
}";script.domain="www.chatbase.co";document.body.appendChild(script)};if(document.readyState==="complete"){onLoad()}else{window.addEventListener("load",onLoad)}})();`
}
</Script>
NEXT_PUBLIC_CHATBOT_ID
This value is automatically added to your Vercel project and identifies the chatbot you created in Chatbase.You can copy this script into your Vercel project to display your chatbot on your website.
<Script>
{
`(function(){if(!window.chatbase||window.chatbase("getState")!=="initialized"){window.chatbase=(...arguments)=>{if(!window.chatbase.q){window.chatbase.q=[]}window.chatbase.q.push(arguments)};window.chatbase=new Proxy(window.chatbase,{get(target,prop){if(prop==="q"){return target.q}return(...args)=>target(prop,...args)}})}const onLoad=function(){const script=document.createElement("script");script.src="www.chatbase.co/embed.min.js";script.id="${
process.env.NEXT_PUBLIC_CHATBOT_ID
}";script.domain="www.chatbase.co";document.body.appendChild(script)};if(document.readyState==="complete"){onLoad()}else{window.addEventListener("load",onLoad)}})();`
}
</Script>
Install Chatbase to your Vercel project.