[Cloud]: How to add authentication to a bot?
# 🤝help
f
Hi, we want to build a custom chatbot UI with our own system integration. We are using Supabase for auth and would like to attach supabase user when bot initiates the task Supabase will contain - user info - chat history - other recorded history Bot can be only used after user is logged into system. How we can achive this? we are ok to develop chat UI ourselves
@rich-battery-69172 is it possible to shed some light here 🙂
r
@full-monkey-19641 there is currently no built in way of doing this, but there are many ways to implement this yourself! One of the ways could be to use User Tags to link an identity to a botpress userId. Another way could be to use Triggers to communicate between a botpress workflow and an external auth API you own (for example you could use a webhook integration)
f
Hi Sly, thanks for the answer it will become bit difficult to do it seems, how can we get the bot user ID for external API? also is it possible to use cloud to develop a custom UI with react?
i checked the docs, can we use tags with botpress cloud?
oh have our own integration?
c
Hmm I have an idea here. Before the user can get answers to his questions in chatbot. The chatbot can ask user for username and the id code. If he provide correct information, then he can use the chatbot normally. U will need to integrate with database i guess.
If the usernamr and password is incorrect the chatbot will end the conversation
f
hmm i dont want to ask it from the user
thats the problem
for example, lets say you are already logged into a website
and bot is a part of it
i dont want users to enter credentials again
bot should already know the user
c
Aha i dont know if its possible with chatbot
Chatbot need to save the users information
f
yah thats what i was also thinking :/
currently botpress holds all information
and since we are using cloud, i dont know how we can have our own custom integration
is this possible @rich-battery-69172 (sorry for mentioning)
r
Yes, you can make integrations. You can also submit your integrations for it to be public to all others: https://github.com/botpress/botpress To build integrations: https://botpress.com/docs/integration/
f
but how can we have a private integration which connects to our system...
oh i see
thanks
its deploying to the botpress cloud
r
yes
f
@rich-battery-69172 is it possible to load an initial chatbot chat history from an external system and use it with BP cloud
r
You could conditionally load the chatbot scripts based on whether the user is logged in or not. You could even have a non-logged-in bot and a logged-in bot. (Have not tested this but I can't see why it wouldn't work.)
f
problem is how to integrate it with bot's chat memory in botpress
r
@by chat memory what do you mean? you can't fake messages on the API side, but if you mean in the Studio (like the summary agent), then you can simply have a hook and set that variable's value your self based on a custom event you sent your bot by API that contains the transcript
f
Hi @rich-battery-69172 is botpress always summarising conversations, i thought it might keep some history at least few lines... what i want to do is, loading this personalized conversation from an external service when chatbot is opened by the user, so bot knows what happen previously and also provide a summary(with hook as you mentioned)
r
@full-monkey-19641 yes you can do that, you can override the value of the summary with a hook
f
tnx will try that @rich-battery-69172
293 Views