Skip to main content
The browser SDK is the typed control surface the runtime exposes on window.Puntego. Use it to point at elements, run guided tours, send messages, register page targets and actions, and listen for what the guide does. This page is the exact signature reference, generated from the published types. Every signature below comes from @puntego/embed. Importing the package augments the global Window, so window.Puntego is fully typed with no extra setup:
Prefer explicit imports? The same types are available as named exports from @puntego/embed/types, and the React hooks re-export the ones you need.
The npm packages (@puntego/embed, @puntego/react) are rolling out to the registry and may still 404 until they are published. The single boot script install works today — see Install.

Get a reference to the SDK

The runtime boots from the page’s boot script and assigns window.Puntego once it is ready. From plain JavaScript you can read it directly, but it is undefined until boot completes. The cleanest way to wait is the loader helper.
(options: LoadPuntegoOptions) => HTMLScriptElement | null
Injects exactly one boot script per page. Returns the script element on the client, or null during server rendering. Options: appId (required), apiUrl, baseUrl, src, nonce. A reachable worker needs apiUrl (the data-gp-api origin); for strict CSP, nonce is propagated to both nonce and data-nonce.
(timeoutMs?: number) => Promise<PuntegoApi | null>
Resolves with window.Puntego once the runtime has booted, immediately if it is already present, or null if timeoutMs (default 8000) elapses first.

Shared types

These types appear across the method signatures below.
A string PublicGuideTarget is treated as a CSS selector. Pass a live Element when you already hold a node, or a PuntegoGuideTarget object to resolve by gp_id, target_id, route, href, selector, or raw xy coordinates.

window.Puntego methods

window.Puntego implements the PuntegoApi interface. Methods are grouped below by what they do. Pay attention to the return column: the visual helpers return void synchronously, while the messaging, voice, and lifecycle methods return a Promise you should await.

Pointing and captions

point() and caption() return void — they are not promises. Do not write await sdk.point(...); there is nothing to await.
markers draws a labeled set of pins; pass durationMs to auto-clear after a delay. clear removes the current pointer, caption, highlight, and markers.

Steps and tours

showSteps renders a static step list; tour walks the visitor through each PuntegoStep in sequence.

Messaging and voice

sendMessage and speak are async — await them. speak uses the workspace voice; see Configuration for enabling voice. When voice provider credentials are absent, the runtime falls back to an internal mock voice.

Lifecycle and visibility

init is async and resolves with the SDK; the boot script calls it for you, so you only call it when you opt into manual init with extra options. show/hide toggle the launcher’s visibility; open/close toggle the conversation panel; destroy tears the runtime down.

Targets, actions, and sensitivity

These methods feed the guide’s grounding and action registry. See the Guide Tools SDK for the full grounding model and how registered targets and actions are used.
The guide cannot see into a shadow DOM (open or closed) unless you register it with registerShadowRoot. Call it for each shadow root you want the guide to reach. See what the guide can and cannot see for the full visibility model.

Outcomes

reportWorkflowResult is async — await it. It records an outcome trace for owner review (completed, cancelled, or failed). It does not create repair drafts or feed a learning loop.

Events

See Events below for the full event map.

The control namespace

window.Puntego.control is a parallel surface for product-owned helpers — the visual primitives, mirrored so your own UI code can drive the guide without touching the conversation lifecycle. It implements PuntegoControlApi:
The signatures match their top-level counterparts: point, caption, highlight, scrollTo, markers, showSteps, and tour return void; speak returns Promise<void>. Registration, messaging, lifecycle, and events live only on the top-level window.Puntego, not on control.

Events

Subscribe with on and unsubscribe with the same handler reference via off. Handlers are fully typed against the event name — each payload below is the exact PuntegoEventMap shape.

Runtime-only methods

The runtime also exposes getPageContext() and locateTarget(). These exist at runtime but are not part of the public TypeScript types, so a typed consumer needs a cast to reach them. Treat them as advanced and unstable.
getPageContext() returns a snapshot of the current page the guide can see; locateTarget() resolves a PublicGuideTarget to its on-page location, or null when it cannot. Because they are untyped, their return shapes may change without notice — prefer the typed methods above for anything you ship.

React hooks (@puntego/react)

@puntego/react wraps the same SDK for React apps. Mount PuntegoProvider once near the root, then call the hooks from any descendant. The provider is SSR-safe (the loader only runs in a client effect), so it works with the Next.js App Router. For the full provider setup, see Frameworks.
  • usePuntego returns the booted window.Puntego SDK for imperative calls (point, sendMessage, on/off, …), or null until it is ready.
  • usePuntegoTarget registers the element behind a ref as a guide target while the component is mounted, and unregisters it on unmount. Pass the same id you reference from an action’s target_id.
  • usePuntegoAction declares an action while the component is mounted and removes it on unmount.
PuntegoProvider props mirror the loader: appId (required), apiUrl (required for a reachable worker), plus optional baseUrl, src, and nonce (propagated to both nonce and data-nonce). See Frameworks.

Next steps

Guide Tools SDK

The grounding model behind targets, actions, and the visual primitives.

Frameworks

Full PuntegoProvider setup for React and the App Router.

What the guide can see

Visibility limits, shadow DOM, iframes, and canvas mode.

Install

The boot script, attributes, and route targeting.