getBilyTrackingId() to read the identifier Bily uses for the current browser. The SDK creates one when needed.
Get the identifier
Correlate it safely
Keep it stable in the browser
The SDK shares the browser identifier with the tracking initializer before the first page view and reuses an existing tracked visitor when one is available. When browser storage is available, it preserves the identifier there. If storage is blocked, the SDK keeps an in-memory identifier for the page session. It can also use an existing Bily identifier when one is available. Call this method before or afterinit().
Handle null on the server
During server rendering, the method returns null. Always handle the nullable return type.
Keep authorization separate
The browser tracking ID is not a password, session token, or authenticated account ID. Never use it to authorize a request. Authorize requests with your own verified session. Useclient.userId only for approved account context.
Client data
Separate browser identity, authenticated users, and consent responsibilities.