Skip to main content

Visitor ID

Call init() before sending a visitor ID to your backend:
The SDK stores one visitor per Era partner with SharedPreferencesAsync. The storage key is:
When preferences are unavailable, the SDK keeps the visitor in memory for the current isolate.

Provide an existing UUID

Pass a lowercase UUIDv4 when your application already has a visitor UUID:
The SDK adds the era_vid_ prefix when needed. Invalid values throw ArgumentError before a request is made.

Verify email or phone

Start a challenge:
Then submit the code collected by your UI:
For phone verification, use VerificationType.phone and an E.164 phone number. Verification proves control of the email address or phone number. It does not sign the user in to your app. The returned eraEndUserId is an opaque continuity ID, not an authorization credential.

Resend a code

Use the returned challenge for the next confirm or resend call. Its ID and expiry can change. Only resend after a user action.

Reset a visitor

Reset after logout, account switching, or a shared-device user change:
Reset removes the local visitor association and creates a replacement. It does not delete the previous Era identity. Requests from the previous visitor are aborted. An operation that crosses the reset boundary throws EraFlutterException with code visitor_reset.

Close the client

close() aborts requests owned by this client. It also closes the HTTP client when Era created it or when you passed ownsHttpClient: true. Calls after close() throw EraFlutterException with code client_closed.