> ## Documentation Index
> Fetch the complete documentation index at: https://docs.seasonlabs.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Node SDK types

> Options and data types exported by the Node SDK.

## EraOptions

Configuration passed to the `Era` constructor.

```typescript theme={null}
interface EraOptions {
  apiKey: string;
  baseUrl: string;
  partnerId: string;
  visitorId?: string;
  partnerEndUserId?: string;
  email?: string;
  phone?: string;
  sessionId?: string;
  mode?: EraMode;
  brandVoice?: string;
  timeoutMs?: number;
  maxRetries?: number;
  logger?: EraLogger;
  debug?: boolean;
}
```

### Fields

<ParamField path="apiKey" type="string" required>
  Your Era API key. Sent as the `X-API-Key` request header.
</ParamField>

<ParamField path="baseUrl" type="string" required>
  Base URL of the Era service, e.g. `https://era.season.team`. Trailing slashes are normalized automatically.
</ParamField>

<ParamField path="partnerId" type="string" required>
  Your partner identifier. Scopes all context blocks to your account.
</ParamField>

<ParamField path="visitorId" type="string">
  Default visitor ID for `turnContext()` calls. Obtain it from the Web or Flutter SDK.
</ParamField>

<ParamField path="partnerEndUserId" type="string">
  Default stable ID for a signed-in user. It does not replace `visitorId`.
</ParamField>

<ParamField path="email" type="string">
  Default backend-verified email address. Requires `partnerEndUserId`.
</ParamField>

<ParamField path="phone" type="string">
  Default backend-verified phone number. Requires `partnerEndUserId`.
</ParamField>

<ParamField path="sessionId" type="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.
</ParamField>

<ParamField path="mode" type="&#x22;async&#x22; | &#x22;sync&#x22;" default="&#x22;async&#x22;">
  `async` returns the previous turn's prepared block. `sync` waits for current-turn context. See [Async and sync modes](/concepts/async-sync).
</ParamField>

<ParamField path="brandVoice" type="string">
  Optional brand voice hint forwarded to the Era service. Influences the tone of `[REC]` action blocks in the context output.
</ParamField>

<ParamField path="timeoutMs" type="number" default="2000 (async) / 30000 (sync)">
  Per-request timeout in milliseconds. On timeout, returns `""` and logs a warning.
</ParamField>

<ParamField path="maxRetries" type="number" default="1">
  Number of retries on transient failures (timeout, network error, 5xx). 4xx errors are never retried.
</ParamField>

<ParamField path="logger" type="EraLogger">
  Custom logger. Defaults to `console.warn` for warnings and `console.log` for info (when `debug` is true).
</ParamField>

<ParamField path="debug" type="boolean" default="false">
  Enables informational Node SDK logs when you do not provide a custom logger.
</ParamField>

***

## EraMode

```typescript theme={null}
type EraMode = "async" | "sync";
```

***

## EraLogger

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

```typescript theme={null}
interface EraLogger {
  warn: (msg: string) => void;
  info: (msg: string) => void;
}
```

***

## EraMessage

A single message in a conversation history array. Matches the shape used by most AI SDKs (Vercel AI SDK, Anthropic SDK, OpenAI SDK).

```typescript theme={null}
interface EraMessage {
  role: string;
  content: unknown;
}
```

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`](/sdk/helpers).

```typescript theme={null}
interface EraTurn {
  role: "user" | "assistant";
  turn_index: number;
  text: string;
}
```

***

## TurnContextOptions

Options passed to `era.turnContext()` to override per-call identity and session values.

```typescript theme={null}
interface TurnContextOptions {
  visitorId?: string;
  partnerEndUserId?: string;
  email?: string;
  phone?: string;
  sessionId?: string;
}
```

`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.
