Try it live: https://seatlayer.io/demo
Open source (MIT) example code for the two ways to sell reserved seats with SeatLayer:
- Hosted: paste one tag into any website. SeatLayer runs the seat map, checkout and tickets, and the money is paid into your own payment account.
- SDK: put the seat map inside your own React app. SeatLayer holds the seats, and your own checkout takes the payment.
This repository is a small Vite and React app. A Next.js version with the same demos is at seatlayer-nextjs-example.
The whole integration is one block of HTML. Replace <YOUR_EVENT_KEY> with the
key from your event's page in the dashboard.
<div
data-seatlayer-event="<YOUR_EVENT_KEY>"
data-layout="picker"
data-checkout="hosted"
data-height="740px"
data-fallback-url="https://app.seatlayer.io/e/<YOUR_EVENT_KEY>">
<a href="https://app.seatlayer.io/e/<YOUR_EVENT_KEY>">Book tickets on SeatLayer</a>
</div>
<script src="https://app.seatlayer.io/sl-event-widget@0.js" defer></script>It works on WordPress, Wix, Squarespace, Webflow and any HTML page. Copy-paste
versions are in examples/hosted/, and React components
that render the same tags are in src/hosted/:
| What you want | HTML | React | Live demo |
|---|---|---|---|
| A seat map for one event | event.html |
SeatLayerEvent |
Paid event, Free event, Standing + tables, 3D view |
| Every upcoming date, then seats | collection.html |
SeatLayerCollection |
Multi-date |
| A season ticket | season-card.html |
BookingCard |
Season ticket |
| A run of shows | performance-card.html |
BookingCard |
Performance groups |
import { SeatLayerEvent } from "./hosted/SeatLayerEvent";
<SeatLayerEvent
eventKey="<YOUR_EVENT_KEY>"
fallbackUrl="https://app.seatlayer.io/e/<YOUR_EVENT_KEY>"
/>;The React components load each script once per page and render again after a client-side route change.
To bring buyers back to your page after a payment that redirects, such as
Stripe, add data-return-url="page" to the tag (or pass returnToPage to the
React components) and list your site under Embed domains in the dashboard.
Without that, buyers finish on the SeatLayer event page.
Each route in this app is one example. The same demos run live at seatlayer.io/demo/sdk.
| Route | What it shows | Documentation |
|---|---|---|
/ |
The headless SeatingChart with your own cart, totals and hold button |
React seating chart |
/seat-picker |
The complete SeatPicker buyer flow and its onCheckout handoff |
SeatPicker reference |
/season |
SeasonPicker: one seat choice held for every performance in a season |
Season picker |
/events |
Several events on one page with one chart, releasing any open hold first | Events API |
/best-available |
bestAvailable(): the best seats together for a party size |
Best available seats |
/control-room |
SeatManager, the staff board, behind an event-scoped mse_ token |
Embedded Control Room |
npm install @seatlayer/reactimport { SeatPicker } from "@seatlayer/react";
<SeatPicker
event="<YOUR_EVENT_KEY>"
publicKey="pk_test_..."
currency="EUR"
style={{ width: "100%", height: 740 }}
onCheckout={(_hold, _seats, handoff) => startCheckout({ holdId: handoff.holdId })}
/>;Send only the holdId to your server. Your server reads the seats and prices
back from SeatLayer with your secret key, charges through your own payment
gateway, and books the hold with your own order id as the booking reference.
This app has no server, so it stops at the handoff. The Next.js example shows
the server half in app/api/hold/route.ts.
Sign in at app.seatlayer.io. Test mode is free and needs no card.
| Key | Where | Looks like | Used for |
|---|---|---|---|
| Publishable key | Dashboard → Developer | pk_test_... |
Browser code (SDK) |
| Secret key | Dashboard → Developer | sk_test_... |
Your server only. Never in browser code |
| Event key | The top of the event's page | ev_... or your own slug |
Hosted tag and SDK |
| Season key | The season's Sell tab, in its booking link | sea_... |
Season tickets |
| Workspace id | In your dashboard address (/w/ws_.../) and in the multiple events code on an event's publish page |
ws_... |
The hosted collection |
The event key is not the pk_ key. If the seat map says the event was not
found, check that you pasted the event key into the event field.
npm install
cp .env.example .env.local # add your keys
npm run devThen open http://localhost:5173.
| Variable | Needed for |
|---|---|
VITE_SEATLAYER_EVENT_KEY |
Every SDK route |
VITE_SEATLAYER_PUBLIC_KEY |
Every SDK route |
VITE_SEATLAYER_EVENT_KEY_2, _3 |
More events on /events (optional) |
VITE_SEATLAYER_SEASON_KEY |
/season |
VITE_SEATLAYER_CURRENCY |
Prices before a hold, for example EUR (defaults to USD) |
Every route shows a setup notice instead of a chart until its keys are present,
so the app runs the moment it is cloned. npm run build writes a static site to
dist/. Serve it from any static host with a fallback to index.html, because
the routes are handled in the browser.
@seatlayer/react gives you SeatPicker, the complete buyer flow,
SeatingChart, the map alone for your own UI, and SeasonPicker for season
tickets, with live availability, seat holds, best available and, on every plan,
a 3D view from each seat. 3D is offered for venues up to 60,000 seats; SeatPicker and SeasonPicker
take max3DSeats to change the limit. A 200,000-seat stadium
chart is ready in 1.95 s on desktop, and you pay only for sold seats: 100 a month are free,
then 10 cents down to 5 cents a seat. The routes in this repository run each of
them with your own keys, and the control room route shows SeatManager, the
staff board.
Render SeatPicker from @seatlayer/react for the whole buyer flow, with live
availability, a priced tray, seat holds, best available, the 3D view and the checkout hand-off, or SeatingChart for the map
alone inside your own cart. Give the wrapping element a definite height, because
the chart fills its box. See src/routes/SingleEventRoute.tsx and
src/components/SeatMap.tsx.
Hold the seats. A hold is a short claim on inventory, and SeatLayer gives each
seat to one hold only, so two buyers cannot both hold it. hold() resolves to
null when the seats were taken in between, so you can ask the buyer to choose
again. See src/lib/useSeatSelection.ts and src/components/HoldCountdown.tsx.
Use SeasonPicker with a published season key. The buyer keeps the same seats
for every performance, and the hold covers all of them or none. The handoff
carries no price: your server prices the package. See
src/routes/SeasonRoute.tsx.
Call bestAvailable(quantity, categoryKey?) on the chart handle. It finds the
best block of seats together and holds it in the same call, or resolves to null
when no block of that size is free, which is not the same as sold out. See
src/routes/BestAvailableRoute.tsx.
Yes. The same seat map ships as @seatlayer/vue, @seatlayer/angular and the
framework-free @seatlayer/js, and the server side is the same. The
options differ by package; check each package's guide.
The Vue and Angular guides are listed under Documentation.
Paste the hosted tag shown above into any page, on WordPress, Wix, Squarespace, Webflow or plain HTML. Buyers pick exact seats and pay through SeatLayer's checkout, with ticket money paid to your own payment account, for $0.50 a ticket with your first 25 free. For a seat map inside your own React app and checkout, use the SDK routes in this repository.
Test mode is free, with no time limit and no card. With the SDK you pay per sold seat: 100 sold seats are free every month, then 10 cents down to 5 cents a seat, with no subscription, and credits you buy never expire. With the hosted tag you pay $0.50 per ticket, with your first 25 free.
- Install the Buyer SDK
- Add a seat map to a React app
- Vue seat map guide
- Angular seat map guide
- SeatPicker reference
- Season picker
- Holds and checkout handoff
- Best available seats
- Server SDKs
- Pricing
MIT. See LICENSE.