π Quickstart
Install the Glance Intelligent Detect SDK, stream live product activity, record a golden path, and surface in-app coach guidance β in a few lines of code.
product_id and runtime API key from the Console,
plus the browser package @glance/intelligent-detect. Analytics webhooks, agent MCP, tours, and email are marked Coming soon in the nav.
Install the SDK
Prerequisites β Node.js 18+ (or any bundler that supports ES modules). The package works in modern browsers and SPA frameworks (React, Vue, Next, Vite, β¦).
npm install @glance/intelligent-detect # or pnpm add @glance/intelligent-detect # or yarn add @glance/intelligent-detect
Configure credentials
Create keys in the Glance Intelligent Detect Console, then keep the runtime key server-side when possible. The browser SDK needs a publishable / product-scoped key (never a master admin key).
# .env (names are conventional β use your platformβs env loader) GLANCE_PRODUCT_ID=prod_xxxxxxxx GLANCE_API_KEY=gid_live_xxxxxxxx GLANCE_BASE_URL=https://gid.glance.com # your Glance Intelligent Detect API origin
Initialize & identify
import { GlanceIntelligentDetect } from "@glance/intelligent-detect";
const gid = GlanceIntelligentDetect.init({
productId: process.env.GLANCE_PRODUCT_ID,
apiKey: process.env.GLANCE_API_KEY,
baseUrl: process.env.GLANCE_BASE_URL,
});
// Call once the user is known (after login / session restore)
gid.identify({
userId: "user_123",
// optional traits for later memory / cohorts
traits: { plan: "trial", role: "admin" },
});
init starts the collector (pageviews + clicks β POST /v1/events)
and the coach client (polls /v1/proactive + /v1/playbook).
π― Step 1 β Connect your activity stream
Glance Intelligent Detect needs a live stream of what each user is doing before paths or coach can run. The SDK collector is the default path β no analytics webhook required.
Manual events (optional)
Most apps only need init + identify. For custom milestones, track explicitly:
gid.track({
type: "custom",
title: "Connected bank account",
canonicalUrl: "/onboarding/bank",
meta: { provider: "plaid" },
});
Event wire format
POST {baseUrl}/v1/events
Header: X-GID-Key: <apiKey>
{
"product_id": "prod_xxxxxxxx",
"user_id": "user_123",
"type": "pageview", // pageview | click | submit | custom
"title": "Page: /settings",
"description": "User viewed /settings",
"raw_url": "https://app.example.com/settings",
"canonical_url": "/settings",
"timestamp": 1710000000.0,
"meta": {}
}
πΊοΈ Step 2 β Record a golden path
This is where Glance Intelligent Detect learns what good looks like. In the Console: Record β perform the happy path in your product β Save. Paths are built from the same SDK event stream β Record does not invent a second collector.
π Step 3 β Add the proactive coach
Steps 1β2 make detection possible. The SDKβs coach client asks the API when to offer help and what to show. You can use the built-in coach UI, or render your own surface from the guidance payload.
Built-in coach (default)
import { GlanceIntelligentDetect } from "@glance/intelligent-detect";
GlanceIntelligentDetect.init({
productId: process.env.GLANCE_PRODUCT_ID,
apiKey: process.env.GLANCE_API_KEY,
baseUrl: process.env.GLANCE_BASE_URL,
coach: {
enabled: true, // default true
brandName: "Acme", // optional label on the sheet
},
});
Bring your own UI
GlanceIntelligentDetect.init({
productId: process.env.GLANCE_PRODUCT_ID,
apiKey: process.env.GLANCE_API_KEY,
baseUrl: process.env.GLANCE_BASE_URL,
coach: {
enabled: false,
onGuidance(guidance) {
// guidance.title, guidance.steps[{ id, label, selector }]
yourCoach.show(guidance);
},
},
});
Under the hood the client calls GET /v1/proactive and GET /v1/playbook. Tour providers (Appcues, Usertour, β¦) are Soon.
π€ Step 4 β Connect an AI support agent
Give your existing chatbot live context on what the user has been doing β pulled over MCP when the agent needs it. Recipes below are on the roadmap.
πΊοΈ What's next
- Console β connect activity, record paths, watch live sessions
- API reference β
/v1/events,/v1/proactive,/v1/playbookSoon - Agent skills for Cursor / Claude Soon