Skip to content

Backend SDK

Ventana de terminal
pnpm add @wodira/sdk
import { createWodiraClient } from '@wodira/sdk';
const wodira = createWodiraClient({
apiKey: process.env.WODIRA_API_KEY!,
});
const events = await wodira.searchEvents({ status: 'PUBLISHED', limit: 20 });
const pricing = await wodira.getPricingCards(events.data[0].id);

Searches events for the authenticated organizer. Use it to sync catalogs, show internal listings, or find an eventId before reading pricing or registrations.

const events = await wodira.searchEvents({
search: 'Madrid',
status: 'PUBLISHED',
limit: 20,
offset: 0,
});

Reads full event details, including categories, form fields, waivers, sponsors, and active supplements.

const event = await wodira.getEvent('event_123');

Returns sellable event categories with quota, registered count, base price, active price, and tiers. Use it before creating a registration.

const pricing = await wodira.getPricingCards('event_123');
const firstCategory = pricing.cards[0];

Creates a registration from a trusted backend using a secret key. Do not use this method in the browser; for public checkout use createRegistrationCheckoutSession from @wodira/browser.

const order = await wodira.createRegistration({
eventId: 'event_123',
categoryId: 'cat_123',
purchaserEmail: 'buyer@example.com',
purchaserName: 'Buyer Name',
termsAccepted: true,
athletes: [{ fullname: 'Ada Lovelace', email: 'ada@example.com' }],
});

Searches registrations/tickets for reconciliation, support, or syncing with external systems.

const registrations = await wodira.searchRegistrations({
eventId: 'event_123',
search: 'ada@example.com',
limit: 50,
});

Updates an existing registration from a backend when the integrator owns support or edit flows.

const ticket = await wodira.updateRegistration('ticket_123', {
purchaserName: 'Ada L.',
});

Cancels or deletes a registration from a backend according to WODira operational rules.

await wodira.deleteRegistration('ticket_123');