import { AlyteMerchant } from '@alyte/sdk';
const alyte = new AlyteMerchant({ baseUrl: ALYTE_URL, token: process.env.ALYTE_API_TOKEN });
// Your shop — your settlement identity. Money lands on YOUR PSP, never Alyte's.
const { merchant } = await alyte.createShop({ name: 'Nova Live', geo: 'DE', currency: 'EUR' });
// Your own Stripe. The secret key is vaulted immediately — only an opaque
// reference is ever stored or returned. The publishable key powers the
// buyer card-capture iframe.
await alyte.linkPsp(merchant.id, {
psp: { id: 'stripe', name: 'Stripe' },
isDefault: true,
secret: process.env.MY_STRIPE_SECRET_KEY,
publishableKey: process.env.MY_STRIPE_PUBLISHABLE_KEY,
});
// Inventory. priceMinor is integer cents: 4900 = €49.00. Floats are refused.
const { event } = await alyte.createEvent({
merchantId: merchant.id, title: 'Nova Live — Warsaw', startsAt: '2026-11-04T19:00:00Z',
});
const { tier } = await alyte.createTier({
eventId: event.id, title: 'General admission',
priceMinor: 4900, currency: 'EUR', kind: 'general', availableCount: 500,
});