MonetizationOS Docs
Workflows ReferenceType Definitions

ReadonlyIdentityWorkflowUtils

type ReadonlyIdentityWorkflowUtils = { [P in keyof WriteIdentityWorkflowUtils]?: never } & ReadIdentityLinksWorkflowUtils & {
  readCustomData: <T>(identifier, key, options?) => Promise<T | null>;
  resolveJwt: (jwtToken) => Promise<JwtVerification>;
};

Type Declaration

readCustomData()

readCustomData: <T>(identifier, key, options?) => Promise<T | null>;

Read an item of previously-stored custom data against a user or session.

Data will be read for the current brand only. If the data was written with the 'crossBrand' option, that must be passed here too to read that value.

Type Parameters

Type ParameterDefault type
Tunknown

Parameters

ParameterTypeDescription
identifierWorkflowUserIdentifierThe user or session to read the data against.
keystringThe key to read. Must be a non-empty string of less than 1000 characters.
options?CustomDataOptionsOptional settings for the operation.

Returns

Promise<T | null>

Example

const userProfile: { name: string } | null = await utils.identity.readCustomData(identity, 'user-profile')

resolveJwt()

resolveJwt: (jwtToken) => Promise<JwtVerification>;

Resolve an identifier from a JWT using your configured JWT integrations. This is typically used with subsequent calls to other identity functions.

Parameters

ParameterType
jwtTokenstring

Returns

Promise<JwtVerification>