Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 19.5.1
Fixed: the `getIdentity()` typing lists the identified user's fields again (`userId`, `name`, `email`, `phone`, `companyId`) next to `gleapId`, `gleapHash` and `grant`; 19.5.0 typed only the session pair and the grant, which broke TypeScript callers that read the user from it. No runtime change.

## 19.5.0
Added: signed customer identity. `Gleap.setUserJwt(token)` identifies the user with an identity token (HS256 JWT signed by your backend); its `userId` claim names the user and every other claim lands on the contact as signed data. The token is kept in memory only, and the call never rejects: refusals are logged.
Added: `Gleap.setUserJwtProvider(provider)` hands Gleap a function that returns a fresh identity token; it is called when the current token expired or is about to.
Expand Down
16 changes: 15 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,21 @@ export namespace Gleap {
* The current session, including `gleapId`, `gleapHash` and `grant` (the signed-session
* credential a signed identify returns; null when the session is not signed).
*/
function getIdentity(): { gleapId: string | null; gleapHash: string | null; grant: string | null; [key: string]: any };
/**
* The current session: the identified user's data (userId, name, email, phone, … as before) plus
* gleapId/gleapHash and, on a Signed project, the session grant. Guests have no userId.
*/
function getIdentity(): {
userId: string;
name?: string;
email?: string;
phone?: string;
companyId?: string;
gleapId: string | null;
gleapHash: string | null;
grant: string | null;
[key: string]: any;
};
function isUserIdentified(): boolean;
function setReplayOptions(options: {
blockClass?: string | RegExp;
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"description": "JavaScript and TypeScript SDK for Gleap, an Intercom alternative with AI customer support, live chat, in-app bug reporting and customer feedback.",
"name": "gleap",
"version": "19.5.0",
"version": "19.5.1",
"main": "build/cjs/index.js",
"module": "build/esm/index.mjs",
"exports": {
Expand Down
Loading