MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / getIdentity

Function getIdentity

apps/api/src/controllers/track.controller.ts:56–74  ·  view source on GitHub ↗
(body: ITrackHandlerPayload)

Source from the content-addressed store, hash-verified

54}
55
56function getIdentity(body: ITrackHandlerPayload): IIdentifyPayload | undefined {
57 if (body.type === 'track') {
58 const identity = body.payload.properties?.__identify as
59 | IIdentifyPayload
60 | undefined;
61
62 if (identity) {
63 return identity;
64 }
65
66 return body.payload.profileId
67 ? {
68 profileId: String(body.payload.profileId),
69 }
70 : undefined;
71 }
72
73 return undefined;
74}
75
76const MAX_OVERRIDE_DEVICE_ID_LENGTH = 64;
77

Callers 1

buildContextFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected