diff --git a/.changeset/moody-garlics-begin.md b/.changeset/moody-garlics-begin.md new file mode 100644 index 0000000..8a72eca --- /dev/null +++ b/.changeset/moody-garlics-begin.md @@ -0,0 +1,5 @@ +--- +'react-use-intercom': minor +--- + +Add intercom_user_jwt diff --git a/packages/react-use-intercom/src/mappers.ts b/packages/react-use-intercom/src/mappers.ts index 4037eee..a704702 100644 --- a/packages/react-use-intercom/src/mappers.ts +++ b/packages/react-use-intercom/src/mappers.ts @@ -74,6 +74,7 @@ export const mapDataAttributesToRawDataAttributes = ( companies: attributes.companies?.map( mapDataAttributesCompanyToRawDataAttributesCompany, ), + intercom_user_jwt: attributes.intercomUserJwt, ...attributes.customAttributes, }); diff --git a/packages/react-use-intercom/src/types.ts b/packages/react-use-intercom/src/types.ts index 8ef2110..927d282 100644 --- a/packages/react-use-intercom/src/types.ts +++ b/packages/react-use-intercom/src/types.ts @@ -135,6 +135,7 @@ export type RawDataAttributes = { user_hash?: string; company?: RawDataAttributesCompany; companies?: RawDataAttributesCompany[]; + intercom_user_jwt?: string; customAttributes?: Record; }; @@ -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