Skip to main content
Era uses three different IDs:

Visitor ID

Create the visitor ID with the Web SDK or Flutter SDK. Send it to your backend with each chat request.
If no visitorId is available, turnContext() returns "" without making an Era request.

Signed-in user ID

When your backend knows the signed-in user, add your own stable ID:
This connects the visitor to the account. partnerEndUserId does not replace visitorId. You can also include a verified email or phone. These values must come from trusted backend data:
Never trust an email or phone value copied directly from client input.

Session ID

Use the same sessionId for every turn in one conversation. Create a new one when the user starts a new conversation. If you omit it, the SDK derives a value from the first user message. Two conversations that start with the same text can therefore get the same derived value. Pass your application’s conversation ID in production.

Constructor defaults

You can set IDs on the client when one client belongs to one visitor:
For a shared server client, pass visitor, user, and session values to each turnContext() call.

Repeated calls

The Node SDK memoizes the latest lookup by visitor, signed-in identity, session, and turn number. Repeated calls for the same latest turn can share one request. Changing any of those values starts a separate lookup.