Your visitors sign in with the Google account they already have, and your Authava bot knows who they are. You set it up once. After that, each visitor clicks one button, and returning visitors are signed in again automatically.
Because the bot knows who is asking, it can do things for that person: save a request under their name, and show them their own requests when they come back. Other visitors never see them.
This page plays the website of Dottie's Typewriter Shop, a made-up shop, so you can try it with your own Google account.
Signed out, Dottie still answers general questions. Ask her to create or list requests and she asks you to sign in first. Dottie's Typewriter Shop is a demo shop, and its repair requests are demo data that we may clear.
| Step | Who | What happens |
|---|---|---|
| 1 | Site owner (one time) | Creates a Google Client ID on Google's Clients page (type Web application), and adds the site's address under Authorized JavaScript origins. Then sends it to their Authava team, who connect it to the bot. The exact steps are in Set It Up Once. |
| 2 | Your visitor | Clicks "Sign in with Google" on your page, then picks their account. No password typed on your site, and nothing to set up. |
| 3 | Your page | Receives Google's sign-in and hands it to the chat with one line: chat.setAuthToken(token). |
| 4 | Authava | Checks the sign-in with Google (Google's signature, your Client ID, not expired, verified email). Then the bot knows the visitor's name and email, and can greet them and answer for them. |
When the bot calls your own systems, such as a webhook that saves a repair request, the call includes the visitor Authava checked: their Authava user id, email and name. Your system uses that to save and look up that person's own records. It never relies on an email the visitor types into the chat.
The site owner does this once, for the whole site. Visitors never do any of it. It is free on Google's side.
https://www.example.com (no path and no trailing slash). Click Create, then copy the Client ID. It ends in .apps.googleusercontent.com. Google's own guide walks through the same steps: Get your Google API client ID. Your Client IDs are also listed on the Credentials page in Google Cloud, where you can add more origins later.<!-- 1. Google's sign-in, and the Authava chat -->
<script src="https://accounts.google.com/gsi/client" async></script>
<script defer src="https://cdn.authava.com/chatbot.js" data-id="YOUR_BOT_ID"></script>
<!-- 2. Where Google's button goes -->
<div id="google-button"></div>
<script>
let chat = null;
let googleToken = '';
// 3. Hand the sign-in to the chat. An empty token signs the visitor out of the chat.
async function tellChat(token) {
googleToken = token;
if (!chat) return;
chat.setAuthToken(token);
await chat.refetchSettings();
}
window.addEventListener('AuthavaChatbotReady', (event) => {
chat = event.detail.client;
if (googleToken) tellChat(googleToken);
});
window.addEventListener('load', () => {
google.accounts.id.initialize({
client_id: 'YOUR_CLIENT_ID.apps.googleusercontent.com',
auto_select: true, // returning visitors are signed in again without a click
callback: (response) => tellChat(response.credential),
});
google.accounts.id.renderButton(document.getElementById('google-button'),
{ theme: 'outline', size: 'large', text: 'signin_with' });
google.accounts.id.prompt();
});
// 4. Your sign-out button
function signOut() {
google.accounts.id.disableAutoSelect();
tellChat('');
}
</script>
No. They only need a Google account, such as Gmail. The Client ID is made once, by the site owner.
The visitor's name, email address and Google account id, after Google has checked them. Never their password, and no access to their Gmail, Drive or anything else in their Google account.
Yes. They chat as a guest, as before. Anything tied to their own account, such as their repair requests, waits until they sign in. To require sign-in for every chat, ask your Authava team.
No. Each request is saved under the visitor Authava checked with Google, and a visitor only ever sees the requests saved under their own sign-in.
Yes. Ask your Authava team to limit sign-in to your company's Google Workspace domain. Without a limit, anyone with a Google account can sign in.
Google's sign-in lasts about an hour. With auto_select on, returning visitors are signed in again when they come back, without a click.
No. A bot without Google sign-in turned on works exactly as before.