Quick start: chat in your mobile app (WebView)
Your backend mints a one-time sign-in link for the signed-in user and the Integration. Your app opens it in a WebView, which lands in that integration's live chat. No secret ever ships in the app.
Flutter: the gauge_support_webview package is the whole
app side in one widget (permissions, uploads, safe areas, sign-out), with a full example app and backend.
React Native, iOS, Android: copy-paste screens in webview-recipes.md. The
background (cookies, push, sign-out rules) is in mobile.md. This page covers the Integration part.
1. Your backend: mint a link
import { GaugeSupport } from '@gauge/support';
const gauge = new GaugeSupport({ apiKey: process.env.GAUGE_API_KEY });
export async function supportLink(user) {
const { url } = await gauge.sessions.mint({
projectId: process.env.GAUGE_APP_ID,
externalRef: user.id,
email: user.email,
integration: 'salon', // lands on /chat?integration=salon
});
return url; // single use, short-lived: mint per open
}import os
from gauge_support import GaugeSupport
gauge = GaugeSupport(api_key=os.environ["GAUGE_API_KEY"])
def support_link(user):
link = gauge.sessions.mint({
"projectId": os.environ["GAUGE_APP_ID"],
"externalRef": user.id,
"email": user.email,
"integration": "salon",
})
return link["url"]Answers: 201 with the URL · 403 integration_not_granted if the user isn't granted salon (grant
it with customer sync integrationKeys) · 404 unknown_integration if the App has no such key.
2. Your app: open it
final url = await api.supportLink(); // your backend, step 1
controller.loadRequest(Uri.parse(url));The WebView signs in, then opens /chat?integration=salon. Gauge checks the grant again there, so an
edited URL cannot reach an integration the user doesn't have.
Notes
- One live chat per user per App in this release. Opening a second integration while a chat is live continues that chat.
- Revoking a key ends the user's live chat on it at their next message.
Quick start: chat in your website or web app (signed-in users)
About 15 minutes. You add one endpoint to your server and one snippet to your page. Gauge then knows which user is chatting and which Integration they are on.
Quick start: API only (your backend talks to Gauge)
No widget and no WebView: your backend provisions users, grants them Integrations and mints sign-in links. Every call uses a server API key (Authorization: Bearer pulse_k_…) with support scope.