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

Function handleIdentify

apps/api/src/controllers/track.controller.ts:258–285  ·  view source on GitHub ↗
(
  payload: IIdentifyPayload,
  context: TrackContext
)

Source from the content-addressed store, hash-verified

256}
257
258async function handleIdentify(
259 payload: IIdentifyPayload,
260 context: TrackContext
261): Promise<void> {
262 const { projectId, geo, ua } = context;
263 const uaInfo = parseUserAgent(ua, payload.properties);
264 await upsertProfile({
265 ...payload,
266 id: payload.profileId,
267 isExternal: true,
268 projectId,
269 properties: {
270 ...(payload.properties ?? {}),
271 country: geo.country,
272 city: geo.city,
273 region: geo.region,
274 longitude: geo.longitude,
275 latitude: geo.latitude,
276 os: uaInfo.os,
277 os_version: uaInfo.osVersion,
278 browser: uaInfo.browser,
279 browser_version: uaInfo.browserVersion,
280 device: uaInfo.device,
281 brand: uaInfo.brand,
282 model: uaInfo.model,
283 },
284 });
285}
286
287async function adjustProfileProperty(
288 payload: IIncrementPayload | IDecrementPayload,

Callers 2

handleTrackFunction · 0.85
handlerFunction · 0.85

Calls 2

parseUserAgentFunction · 0.90
upsertProfileFunction · 0.90

Tested by

no test coverage detected