Skip to main content

EraOptions

Configuration passed to the Era constructor.

Fields

string
required
Your Era API key. Sent as the X-API-Key request header.
string
required
Base URL of the Era service, e.g. https://era.season.team. Trailing slashes are normalized automatically.
string
required
Your partner identifier. Scopes all context blocks to your account.
string
Default visitor ID for turnContext() calls. Obtain it from the Web or Flutter SDK.
string
Default stable ID for a signed-in user. It does not replace visitorId.
string
Default backend-verified email address. Requires partnerEndUserId.
string
Default backend-verified phone number. Requires partnerEndUserId.
string
Default conversation session ID. If omitted, the SDK derives a deterministic value from the first user message. Prefer an application-generated unique conversation ID in production.
"async" | "sync"
default:"\"async\""
async returns the previous turn’s prepared block. sync waits for current-turn context. See Async and sync modes.
string
Optional brand voice hint forwarded to the Era service. Influences the tone of [REC] action blocks in the context output.
number
default:"2000 (async) / 30000 (sync)"
Per-request timeout in milliseconds. On timeout, returns "" and logs a warning.
number
default:"1"
Number of retries on transient failures (timeout, network error, 5xx). 4xx errors are never retried.
EraLogger
Custom logger. Defaults to console.warn for warnings and console.log for info (when debug is true).
boolean
default:"false"
Enables informational Node SDK logs when you do not provide a custom logger.

EraMode


EraLogger

Interface for providing a custom logger (e.g. pino, winston).

EraMessage

A single message in a conversation history array. Matches the shape used by most AI SDKs (Vercel AI SDK, Anthropic SDK, OpenAI SDK).
Era filters the array for role: "user" and role: "assistant" messages only. Content can be a plain string or a multimodal content array — Era extracts the text portions automatically.

EraTurn

The normalized turn format that Era sends to the service. You rarely need to use this directly; it is produced internally by messagesToTurns.

TurnContextOptions

Options passed to era.turnContext() to override per-call identity and session values.
visitorId must resolve from the call or constructor defaults. partnerEndUserId is optional. Email and phone assertions require partnerEndUserId and must come from trusted backend data.