Skip to content

Add intercom user jwt #818

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 10, 2025
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
5 changes: 5 additions & 0 deletions .changeset/moody-garlics-begin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'react-use-intercom': minor
---

Add intercom_user_jwt
1 change: 1 addition & 0 deletions packages/react-use-intercom/src/mappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export const mapDataAttributesToRawDataAttributes = (
companies: attributes.companies?.map(
mapDataAttributesCompanyToRawDataAttributesCompany,
),
intercom_user_jwt: attributes.intercomUserJwt,
...attributes.customAttributes,
});

Expand Down
7 changes: 7 additions & 0 deletions packages/react-use-intercom/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ export type RawDataAttributes = {
user_hash?: string;
company?: RawDataAttributesCompany;
companies?: RawDataAttributesCompany[];
intercom_user_jwt?: string;
customAttributes?: Record<string, any>;
};

Expand Down Expand Up @@ -217,6 +218,12 @@ export type DataAttributes = {
* @see {@link https://www.intercom.com/help/en/articles/186-group-your-users-by-company}
*/
companies?: DataAttributesCompany[];
/**
* The JWT for authenticating users in the Messenger
*
* @see {@link https://www.intercom.com/help/en/articles/10589769-authenticating-users-in-the-messenger-with-json-web-tokens-jwts}
*/
intercomUserJwt?: string;
/**
* You can do this anytime by adding additional key/value pairs to your intercomSettings code snippet
* These should be raw snake_cased
Expand Down
Loading