Skip to main content
Browser session capture for Hinto. Hinto investigates support tickets by reading evidence. This SDK is where most of that evidence comes from: it records what your users actually did in your app (page views and navigation, privacy-safe clicks, console messages, network request outcomes, and JavaScript errors), so an investigation can cite a real session instead of guessing. It is framework-agnostic, has no runtime dependencies, and never records form values, request or response bodies, headers, or cookies.

Install

Use whichever package manager your project already uses.

Native Support conversations

Since 0.4.0, the root import and IIFE stay focused on session capture. The old widget launcher and root widget methods are removed. For an in-product customer conversation, call connectConversation from @gethinto/browser-sdk/conversation with the same publishable key as ingestKey; it resolves your organization and Signal app from that key. Install @gethinto/native-support-react@0.6.2 for styled React 19 components. Follow the Hinto Signal guide. Existing widget tickets remain historical read-only records in Hinto. Since 0.6.0, a conversation carries status: the support phase (received, investigating, with_team, replied, or resolved) and the steps the customer sees, worded with your organization’s copy. It is null when the server sends none or sends one this version does not understand. A message’s origin is "automatic" for your team’s automatic reply and null otherwise; unreadCount() does not count the automatic reply. The runtime polls at the server’s status.refreshAfterMs, between 3 and 60 seconds, and every 15 seconds without a status. While the conversation is closed, a visible tab still refreshes unreadCount() about once a minute and when it returns to the foreground. A hidden tab keeps the last-known count. Since 0.7.0, runtime.offers holds the Hinto Signal help offer for the signed-in customer’s journeys. It renders nothing. Subscribe, call show(id) and render your own offer only when it returns "ok", then call dismiss(id), or contact(id, { message }) when the customer chooses Contact support. Call await offers.refresh() after journey.succeed() to drop the offer at once. Since 0.8.0, contact queues one message in the customer’s words that names the offer, and the runtime sends it when the conversation is open: call runtime.open() after it. It joins the active conversation or starts one, and a second click while it is on its way answers "unavailable". accept is removed. The React kit’s Support.HelpOffer does all of this for you.

Use your own chat

Since 0.7.0, a product that already has a chatbot keeps it. Pass bot: { name } to connectConversation, hand the conversation to your team with send({ handoff: { reason, summary, transcript } }), and mirror every message your bot shows the customer with shareBotMessage({ id, text }) while the conversation is open. When it resolves, your bot answers again. Follow Use your own chat, which also covers bots that run only on a server.

Set up

Initialize once at app startup, then link each signed-in user to their session with identify.
The SDK sends to https://api.gethinto.com unless you pass apiUrl for a different Hinto deployment. Pass your publishable key (hinto_pk_…) as apiKey. It is in Hinto under Settings > Hinto Signal, and every website and mobile app of your organization uses the same one. It can only send session data and open support; it cannot read tickets, customers, or investigations. It ends up in your frontend bundle by design, but keep it in an environment variable so you can roll it without a code change. Add each website’s exact origin under Products in Settings > Hinto Signal. Never put a secret key (hinto_sk_…) in a website.

Why identify matters

Without identify, sessions still arrive, but nobody can tell whose they are. An investigation into “Priya cannot export her report” needs Priya’s session, and identify is how Hinto finds it. Call it once the signed-in user is known, and again after a user switch. You can identify by email as above, or by your own user id with { kind: "external_id", value: user.id }. Native Support requires the external_id identity, with the same id the support token carries as sub: the id your server signs, or your sign-in provider’s user id when the app passes the provider’s token. The support widget reads the user’s name, email, and company from that token, not from identify. See Hinto Signal. Optional fields (additive since 0.3.0): name, company, companyId, and traits. Older SDKs that send only { kind, value } keep working. When name is omitted, the customer record uses the identifier itself (for example the email address), never a guessed local-part.

API

initHinto(config) returns a client with:
  • identify(identity): attach the current session to a customer. identify(null) at sign-out starts a new anonymous session. With Native Support, the conversation runtime sets the identity; do not call identify with another kind of identity once it runs.
  • journey(key): report one flow. See Journeys.
  • track(name, properties?): record a custom event.
  • flush(): send any buffered events now.
  • shutdown(): stop capture at once. Events not yet sent are dropped, including a send in progress, so await hinto.flush() first.
Every initHinto option is in Install the browser SDK.

Privacy

The SDK records what your app did, not what your users typed. It never records form values, request or response bodies, headers, or cookies. Network capture stores the method, URL, status, and duration only. Query strings are stripped from every captured URL by default. Every captured URL (path segments included) and every payload string passes through redaction patterns before it leaves the browser. The built-in patterns scrub email addresses, bearer tokens, sensitive query parameters (token, secret, password, API keys, OAuth code, and suffixed names like reset_token), and long opaque strings such as hex ids and API tokens. Two knobs let you tune this:
Since 0.2.0, allowUrlSearchParams takes an array of parameter names instead of a boolean.

License

MIT

Classes

Interfaces

Functions

Type Aliases

Variables