Developer Docs
API Reference
Services
Id Generation
Functions
Function: generateUniqueId()

web


web / lib/services/id-generation / generateUniqueId

Function: generateUniqueId()

generateUniqueId(data, idStrategy): string

Parameters

data

unknown

idStrategy

undefined |

{ type: "external" | "computed" | "auto" | "hybrid"; externalIdPath?: null | string; computedIdFields?: null | object[]; duplicateStrategy?: null | "version" | "skip" | "update"; }

type

"external" | "computed" | "auto" | "hybrid"

How to generate unique IDs for events

externalIdPath?

null | string

JSON path to ID field (e.g., 'id' or 'metadata.uuid')

computedIdFields?

null | object[]

Fields to combine for unique hash

duplicateStrategy?

null | "version" | "skip" | "update"

What to do when duplicate is found

Returns

string