Share feedback, ideas and get community help

Updated 5 months ago

Hide bot and bubble if not authorized

At a glance

The community member is trying to find a way to hide or disable a bot's bubble/interface if the URL hosting the bot does not meet certain criteria. They can easily create a flow in the bot that displays a "You are not authorized to use this bot" message, but they want to hide the bot entirely if the URL doesn't meet the criteria they check with a webhook. The community member suggests using the typebot API to add CSS to the bot to hide everything based on the webhook response, and they also mention being able to change the button background and icon color using the API. They are considering this approach, but are unsure about how to apply the CSS to the current bot session and not every call of the bot on other pages.

I understand how to get the main document url from the page hosting the bot, and can run a webhook to validate the url but, is there a way to "hide" or disable the bubble/bot after checking, if the url doesn't meet criteria? I can easily put a path in the bot flow that routes to a "You are not authorized to use this bot" message displayed, but I'm wanting to hide even the bubble if the url doesn't even meet criteria that I check with a webhook as the first step in the bot.
R
1 comment
I may have answered my own question. It looks like I could use the typebot API to add CSS to the bot to hide everything, based on the result of a webhook to check url. I also see I can change the button background and icon color, also in the API. Is that the most sensible approach? So, get url > send to webhook > webhook responds with something like "not authorized" > flow changes CSS to hide bot using API. Now to figure out how to apply the CSS to the current bot session, not every call of the bot on other pages.
Add a reply
Sign up and join the conversation on Discord