---
title: "Node.js server SDK"
description: "Install @seatlayer/server 0.7.0, inspect an authoritative hold, book with a stable reference, and use the exact Node.js resource namespaces."
---

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

# Node.js server SDK

Use `@seatlayer/server` from Node.js or TypeScript code running in a trusted
backend. Version `0.7.0` requires Node.js 20.19.4 or newer and has no runtime
dependencies.

## Install and create the client

```bash
npm install @seatlayer/server@0.7.0
```

```ts
import { SeatLayer } from '@seatlayer/server';

const seatlayer = new SeatLayer(process.env.SEATLAYER_SECRET_KEY!);
if (seatlayer.mode !== 'test') {
  throw new Error('Use a test key while integrating.');
}
```

Keep `SEATLAYER_SECRET_KEY` in the server environment. Never expose the client
or its `sk_…` credential to browser or mobile code.

## Exact resource surface

The client exposes `charts`, `channels`, `events`, `inventory`,
`performanceGroups`, `sessions`, `seasons`, `templates`, `webhooks`, and
`workspaces`.

`seatlayer.performanceGroups` contains all 13 released operations:
`listPerformanceGroups`, `createPerformanceGroup`,
`retrievePerformanceGroup`, `deletePerformanceGroup`,
`activatePerformanceGroup`, `closePerformanceGroup`,
`retrievePerformanceGroupLifecycle`,
`createPerformanceGroupBuyerAccessSession`,
`listPerformanceGroupBuyerAccessSessions`,
`revokePerformanceGroupBuyerAccessSession`, `retrievePerformanceGroupHold`,
`bookPerformanceGroupHold`, and `retrievePerformanceGroupBooking`.

`seatlayer.seasons` contains all 48 frozen `0.7.0` operations across catalogue,
lifecycle, Plans and sales, buyer handoff, holder import, renewals, amendments,
reports, recovery, outbox, audit, and support export. Exact method names retain
the domain prefix, for example `createSeason`, `publishSeasonPlan`,
`bookSeasonHold`, `commitSeasonRenewalOffer`, and
`exportSeasonSupportSnapshot`. Source-only occurrence return/reclaim methods are
not part of the `0.7.0` package.

The same 13 Performance Group and 48 Season wire operations are released in all
seven official server SDKs; only language naming differs.

The `0.7.0` typed `createPerformanceGroup` parameters cover the default
`fixed` policy but do not expose the newer REST `inclusionMode` field. Use the
[REST/raw-request path](/server-api/performance-groups/#create-a-run) when you
need `flexible_dates`; this field-level caveat does not reduce the SDK's 13
operation coverage.

## Inspect and book an Event hold

The buyer surface gives your backend an opaque `holdId`. Retrieve it from
SeatLayer before calculating the order in your trusted commerce system, then
book once with your own stable order identifier:

```ts
const eventKey = process.env.SEATLAYER_EVENT_KEY!;
const holdId = process.env.SEATLAYER_HOLD_ID!;
const bookingRef = process.env.ORDER_ID!;

const hold = await seatlayer.inventory.retrieveHold(eventKey, holdId);
const labels = hold.items.map((item) => item.label);
// Price from hold.items and authorize payment in your commerce system here.
const booking = await seatlayer.inventory.book(eventKey, {
  holdId,
  labels,
  bookingRef,
});
```

Do not calculate a charge from browser-submitted totals. A `bookingRef` is your
commerce system's immutable join to SeatLayer inventory, not a random retry ID.
If the booking response is lost, call
`seatlayer.inventory.retrieveBooking(eventKey, bookingRef)` before deciding
whether to repeat the exact same hold, labels, and reference.

## Errors, retries, and pagination

Branch on `SeatLayerAuthError`, `SeatLayerConflictError`, and
`SeatLayerRateLimitError`. Mode mismatch is available as
`SeatLayerAuthError.isModeMismatch`; sold out is available as
`SeatLayerConflictError.isSoldOut`.

Reads retry `408`, `429`, and `5xx` responses with backoff. These 14 methods
also retry with one exact `Idempotency-Key`: `charts.create`, `charts.copy`,
`templates.instantiateTemplate`, `events.create`, `workspaces.create`,
`performanceGroups.createPerformanceGroup`, and the Season methods
`createSeason`, `updateSeason`, `deleteSeason`, `createSeasonPlan`,
`duplicateSeasonToLive`, `createSeasonHolderImport`,
`createSeasonRenewalOffers`, and `createSeasonAmendment`. Holds, bookings,
lifecycle changes, show-once secrets, and raw mutations are single-attempt.

Large lists use async iteration:

```ts
for await (const event of seatlayer.events.listAll()) {
  await syncEvent(event);
}
```

That helper is Event-specific. Performance Group and top-level Season list
methods return one cursor page; pass the response's opaque `nextCursor` back as
`cursor` to the same list method until it is absent.

See [errors, retries, and idempotency](/server-sdk/reliability/) for the full
contract.

## Verify and continue

- [npm package `0.7.0`](https://www.npmjs.com/package/@seatlayer/server/v/0.7.0)
- [tagged source and package README](https://github.com/seatlayer/seatlayer-node/tree/v0.7.0)
- [`performanceGroups` methods at `v0.7.0`](https://github.com/seatlayer/seatlayer-node/blob/v0.7.0/src/resources/performance-groups.ts)
- [all `seasons` methods at `v0.7.0`](https://github.com/seatlayer/seatlayer-node/blob/v0.7.0/src/resources/seasons.ts)
- [server API operation support](/server-api/operation-support/)
- [OpenAPI 3.1 reference](/openapi.json)

Verify the flow with a test key, a test Event, and a real test hold. Then add
[webhook verification](/server-sdk/webhooks/), choose the correct [inventory
model](/start/inventory-models/), and complete the [going-live
checklist](/start/going-live/).

Source: https://docs.seatlayer.io/server-sdk/node/index.mdx
