
JavaScript and TypeScript SDK for Gleap, an Intercom alternative with AI customer support, live chat, in-app bug reporting and customer feedback.
Repo GleapSDK/JavaScript-SDK, read from GitHub 4 h ago. GleapSDK has not joined Take My Repo.
Changed: the feedback form's Record screen uses the microphone only when Developer options → Microphone is on, and then it starts muted until the user turns it on. Until this version, form recordings asked for the microphone whenever the browser had one, regardless of that setting, and on a site that already had microphone permission the browser gave it without a prompt. The mic button is hidden when the setting is off. Projects that want sound in form recordings turn the setting on.
Added: product tours and tooltips can point at elements inside open shadow roots. A selector continues into a shadow root with host >>> inner, the element picker stores such selectors, and the highlight, the interaction lockout and click-to-continue work for those elements.
Changed: the feedback form's capture step uses the current tab on desktop Chromium. Mark the bug takes its screenshot from the tab, drawings included (one click in the browser's share dialog). Where the tab can't be captured, or the dialog is declined, the report renders the page on the server as before. Record screen offers the current tab first and records MP4 or WebM with a seekable duration.
Changed: automatic replay recording starts once the page is idle (at most 2 s after Gleap.initialize; after the page's load event in Safari), so it no longer competes with the page while it loads. With replays off, the recorder never runs.
Fixed: on iPhone (iOS Safari) the launcher sometimes didn't open the widget until a reload. The Messenger frame now reloads or resets itself when it doesn't answer within 10 s, recovers after back/forward navigation, and resets cleanly when the SDK starts again.
Fixed: a product tour whose start URL has a query string lost the tour parameter in the redirect, so the tour never started.
Fixed: a second tour in the same page load advanced two steps per click.
Fixed: index.d.ts declares setAiChatbarPlaceholder, getChecklistData, setOfflineMode, close(resetRoutes), onToken and cancelStream. They existed in the SDK, but TypeScript projects got type errors calling them.
Fixed: package.json declares "license": "MIT", matching the LICENSE file. It said Commercial, which license scanners report as a finding. No code changes.
Full Changelog: 19.7.0...19.8.0
Changed: a signed session that expires now ends, as in Intercom's web Messenger. When the grant runs out (the project's "Signed login lasts", 7 days by default, or sessionDuration) and no fresh identity token arrives (no setUserJwt on that page load, and the JWT provider returns null or is not set), the SDK ends the identified session and continues as a fresh visitor with no conversation history, like Gleap.clearIdentity() (the JWT provider stays set). Until now the user stayed identified but unsigned (14 days of history, protected fields read-only). Before ending it, the SDK tries once to sign the session again: an identify already on its way, the token passed to setUserJwt, or the JWT provider. A network failure keeps the session. A later setUserJwt (or provider token) signs the user in again, and the server merges their visitor activity on this device into their contact.
Added: a page left open past the expiry is checked when the grant runs out. If another tab renewed the grant, the SDK takes it from the cookie. If the messenger is open, the session ends once it is closed, at the latest an hour after the expiry (Intercom's one-hour cookie for activity after expiry).
Unchanged: users identified with Gleap.identify(userId, data) and no token or hash were never signed and stay identified. A grant that is only missing before its expiry (cookie deleted, cookies off) is restored as before. Classic projects are not affected.
The SDK keeps { gleapId, userId, exp } of the last grant (no credential) in the signed-session-<projectId> cache entry and cookie, so a reload after the expiry knows the session was signed.
Documentation only: README, package description and doc comments name the Project ID (Settings → Project → General) and sign users in with setUserJwt. No code changes.
Changed: the key Gleap.initialize takes is now called Project ID (formerly "SDK key" or "API key"). The value is the same and every existing key keeps working; nothing needs to change in your app. Typings, JSDoc and the README name the parameter projectId.
Added: Gleap.initialize({ projectId, sessionDuration }) takes the Project ID inside the options object, and Gleap.initialize(undefined, { projectId }) works too. The positional form Gleap.initialize(projectId, options) and the legacy boolean second argument are unchanged. The options are typed as Gleap.InitializeOptions.