Skip to main content
Use this page to find an SDK method quickly. The examples below show the full public callable surface. Follow the links in each section for options, return types, and longer examples.

Node SDK

Package: @seasonlabs/era-node

new Era(options)

Creates the Node SDK client.
See all constructor options

era.turnContext(messages, options?)

Returns the context block to add to your system prompt. The conversation must end with a user message, and a visitorId must be available on the client or the call.
Expected service failures return "", so your agent can continue without Era context. Read the full method reference.

messagesToTurns(messages)

Converts common chat-message objects into the normalized turns sent to Era. turnContext() already calls this function, so most integrations do not need to call it directly.
See normalization rules and examples

Vercel AI SDK helpers

Package: @seasonlabs/era-node/ai-sdk

withEra(model, era, options?)

Wraps a Vercel AI SDK model and adds Era context before every model call.

eraMiddleware(era, options?)

Returns the Era middleware when you want to compose it with other Vercel AI SDK middleware.
See Vercel AI SDK examples

Web SDK

Package: @seasonlabs/era-web

new EraWeb(options)

Creates a browser client with a publishable key.

Methods

See the Web SDK client reference

Flutter SDK

Package: era_flutter

EraFlutter(...)

Creates a Flutter client with a publishable key.

Methods

The optional EraFlutterStorage interface has three methods: getString(key), setString(key, value), and remove(key). Implement it only when you need storage other than the default SharedPreferencesAsync. Flutter failures throw EraFlutterException. It exposes code, message, retryable, and statusCode, and provides toString() for logging. See the Flutter SDK client reference

Exported values and types

The Node SDK also exports VERSION, EraMode, EraLogger, EraOptions, EraMessage, EraTurn, and TurnContextOptions. See Node SDK types. The Web SDK exports EraWebError, EraWebOptions, VerificationType, VerificationChallenge, VerificationStatus, and VerificationConfirmation. See Web SDK types and Web SDK errors. The Flutter package exports EraFlutterException, EraFlutterStorage, VerificationType, VerificationChallenge, VerificationStatus, and VerificationConfirmation. See Flutter SDK types and Flutter SDK errors.