Skip to content
SupaKnock
Menu
← All guides

Chat

Add chat to your website or app

Add a chat widget to your website, or build chat into your app using your existing login.

Website widget or in-app chat?

A visitor on your website

Use the ready-made widget. Visitors can send a message without signing in and come back to it in the same browser.

A signed-in user in your app

Your developer builds the chat screen and connects it to your app’s login. People can pick up their conversations on another device when they sign in.

Add the website widget

  1. Open your project’s Website chat settings and enable chat.
  2. Add your website’s address, such as https://myapp.com. Add https://www.myapp.com separately if your site uses that address too. Don’t include a page path or trailing slash.
  3. Copy the div-and-script snippet into your website. Your developer can change the colors, light or dark theme, and chat button in your site’s code.
  4. Send a test message and reply from Live chat in the SupaKnock workspace.

You don’t need a project API key for the widget. If it won’t load, first check that you’ve allowed the right website address. Your developer may also need to allow the widget in your site’s content security policy.

Why a visitor doesn’t need a login

When someone sends their first message, the widget saves a temporary access token in their browser. Think of it as a key to that one conversation. It can’t open your workspace or anyone else’s messages. Simply opening the widget or typing doesn’t start a conversation.

The saved token lets them return to the chat on that website. They can lose access if they clear their browser data, end the chat or let the token expire. Because there’s no account, they can’t recover the conversation by signing in on another device.

Connect chat to your app’s login

  1. Enable chat for the project and create a project API key with participate.
  2. Your backend checks who’s signed in, then sends their user ID to SupaKnock to get a temporary chat token.
  3. Your app uses that token to show the user’s conversations and send their messages. Your backend requests a fresh token when needed.
  4. For a web app, add its website address to the allowed origins in project settings. An iPhone or Android app uses the native customer-session API, which doesn’t need a website origin.

The ready-made widget doesn’t pick up your app’s login. To connect conversations to signed-in users, your developer needs to build a chat screen using the API.

Reply, with or without AI

Read and reply to messages in your SupaKnock inbox. Set business hours so people know when you’re likely to answer. They can still leave a message outside those hours.

You can also turn on AI answers. Visitors can ask for a person, and you can take over without starting a new conversation. See how AI chat works.

To notify signed-in customers when you reply, connect a webhook to your app’s notification system. Set up support-reply notifications →

Common questions

Can the widget use my app’s signed-in user automatically?

No. The widget treats visitors as anonymous. To keep chat history with someone’s account or send them reply notifications, use the customer chat API with your app’s existing login.

Does anonymous mean anyone can read the conversation?

No. The visitor needs the token saved in their browser to read their chat. Your administrators can read it too. Allowing a website address tells SupaKnock where the widget may run; it doesn’t prove who the visitor is or prevent every kind of spam.

Will users see replies if they close the app?

Replies are saved, so users can read them when they return, as long as they still have access to the chat. To alert signed-in users while they’re away, your backend needs to receive reply webhooks and send a push notification.

Can I ask a guest for an email?

Yes. Turn on optional email collection in chat settings. You can use that address to follow up yourself. SupaKnock doesn’t verify it, create an account from it, or automatically send emails or push notifications to that guest.