Events SDK
Canonical event dates and paid-admission projections.
Events SDK
For a complete task, start with the Events guide. This reference keeps the public SDK boundary; use SDK basics for imports and peers.
Event ranges and all-day dates
client.events.getRange() returns allDayStartDate and exclusive
allDayEndDateExclusive on each all-day event and occurrence. Render that date
pair when isAllDay is true. The instant pair is a server-derived
local-midnight compatibility/index shadow and must not be converted into the
viewer timezone to recover display dates. Timed rows keep startsAt/endsAt
authoritative and return both date fields as null.
Events Admission
Use client.events.getAdmissionAvailability({ occurrence }) to render public
paid-admission choices for one event occurrence.
import { createClient } from '@01.software/sdk'
type Client = ReturnType<typeof createClient>
export async function readAdmissionChoices(client: Client, occurrence: string) {
const admission = await client.events.getAdmissionAvailability({ occurrence })
if (admission.admissionTypes.length === 0) {
return { kind: 'empty' as const, admission }
}
return { kind: 'choices' as const, admission }
}The response includes event/occurrence identity, admission type identity,
productId / variantId for the existing cart flow, public price presentment,
and a remaining-capacity hint. Each admission type row includes the requested
occurrenceId, including all-event admission types. It does not expose raw
priceReference, product inventory, holds, checkout/order records, payment
sessions, provider event ids, or order-money internals.
Checkout still uses ecommerce helpers: add the returned product/variant to a cart
with admissions: [{ eventId, occurrenceId, admissionTypeId }], then use the
canonical Cart → Checkout → PaymentSession flow. This helper is separate from
the event-commerce events.products projection.
The singular admission request/response alias was removed in SDK 0.45.0;
admissions is required for all Cart line input and responses.
Range and free registration methods
getRange returns shaped events and occurrences with registration policy metadata. register submits a free registration; guest lookup/cancellation use the returned guest credential. Cancellation invalidates that credential, so do not redirect into a guest readback with it. The Events task owns the complete availability/intake/manage flow and distinguishes its app-owned hosted sign-in gate from unavailable server-enforced signupRequired. Paid admission uses the separate cart/checkout projection in Paid admission.
My registrations
After customer sign-in, call client.events.listMyRegistrations({ page: 1, limit: 10 }).
It requires the customer JWT and matching publishable key with events enabled;
a server key or operator session cannot impersonate the customer. page
defaults to 1; limit defaults to 10 and has a maximum of 100. Results contain
docs, totalDocs, limit, page, totalPages, hasNextPage, hasPrevPage.
Each registration has references, public title/time metadata, registration and
attendance status, quantity and created time. Missing or non-public metadata is
null while references/status remain. PII expiry/cleanup preserves the same DTO.
Guest credentials, attendee/answers, audit fields and locations are absent.
All responses use no-store; same-email guest records are not linked.
createServerClient().events excludes this customer-only method. A server BFF
creates a client per request with
createClient({ publishableKey, customer: { persist: false, token } }), using the
customer's JWT, and calls client.events.listMyRegistrations().