{"_id":"@boomevents/sdk","_rev":"2-488661da4188c3d618a1d51d60266566","name":"@boomevents/sdk","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@boomevents/sdk","version":"0.1.0","keywords":["boom","boomevents","ticketing","sdk","openapi","fetch","astro","nextjs"],"author":{"name":"BOOM Events","email":"dev@boomevents.org"},"license":"MIT","_id":"@boomevents/sdk@0.1.0","maintainers":[{"name":"boomeventsorg","email":"services@boomevents.org"}],"homepage":"https://github.com/boomeventsorg/boom-sdk#readme","bugs":{"url":"https://github.com/boomeventsorg/boom-sdk/issues"},"dist":{"shasum":"1a2a43dab036f519b4e905d683c873ae62ea865a","tarball":"https://registry.npmjs.org/@boomevents/sdk/-/sdk-0.1.0.tgz","fileCount":36,"integrity":"sha512-ynfjBabfZoEEURe0nHqZagUmKDO3EMzlBFahtkEoTo8AOXQ9Sn+grT78CRMx1n8sw7atVKwSkPaM0GvJhSg2hA==","signatures":[{"sig":"MEQCIH2pb097ahQ/Dq6qc5tv6L8128ARBbl4YPQJtbXxPUF+AiAotU8xqee/d1UhTBiQOlcoGR4BpZK/jeVOUYrCBThvgQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@boomevents%2fsdk@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":1468596},"main":"./dist/index.cjs","type":"module","_from":"file:boomevents-sdk-0.1.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./management":{"import":{"types":"./dist/management/index.d.ts","default":"./dist/management/index.js"},"require":{"types":"./dist/management/index.d.cts","default":"./dist/management/index.cjs"}},"./storefront":{"import":{"types":"./dist/storefront/index.d.ts","default":"./dist/storefront/index.js"},"require":{"types":"./dist/storefront/index.d.cts","default":"./dist/storefront/index.cjs"}},"./package.json":"./package.json"},"scripts":{"lint":"eslint .","test":"vitest run","build":"tsup","clean":"rimraf dist src/generated","smoke":"node scripts/smoke.mjs","format":"prettier --write \"{src/core,scripts,docs}/**/*.{ts,mjs,md}\" \"*.{json,md,ts}\"","barrels":"node scripts/build-barrels.mjs","version":"node scripts/sync-version.mjs && git add src/core/version.ts","generate":"node scripts/generate.mjs","lint:fix":"eslint --fix .","typecheck":"tsc --noEmit","test:watch":"vitest","docs:surface":"node scripts/build-api-surface-doc.mjs","format:check":"prettier --check \"{src/core,scripts,docs}/**/*.{ts,mjs,md}\" \"*.{json,md,ts}\"","test:coverage":"vitest run --coverage","generate:management":"node scripts/generate.mjs --surface=management","generate:storefront":"node scripts/generate.mjs --surface=storefront"},"_npmUser":{"name":"boomeventsorg","email":"services@boomevents.org"},"_resolved":"/tmp/5ba520890d0381d507d68d1609984d58/boomevents-sdk-0.1.0.tgz","_integrity":"sha512-ynfjBabfZoEEURe0nHqZagUmKDO3EMzlBFahtkEoTo8AOXQ9Sn+grT78CRMx1n8sw7atVKwSkPaM0GvJhSg2hA==","repository":{"url":"git+https://github.com/boomeventsorg/boom-sdk.git","type":"git"},"_npmVersion":"10.9.8","description":"TypeScript SDK for the BOOM Organizer Storefront and Organizer Management APIs — generated from OpenAPI, running on fetch","directories":{},"sideEffects":false,"_nodeVersion":"22.23.2","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","eslint":"^9.15.0","rimraf":"^6.0.1","vitest":"^3.2.7","prettier":"^3.4.1","@eslint/js":"^9.39.5","typescript":"^5.7.2","@types/node":"^22.10.0","typescript-eslint":"^8.15.0","@vitest/coverage-v8":"^3.2.7","@openapitools/openapi-generator-cli":"^2.13.4"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.1.0_1786729801557_0.49597751761698916","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@boomevents/sdk","version":"0.2.0","description":"TypeScript SDK for the BOOM Organizer Storefront and Organizer Management APIs — generated from OpenAPI, running on fetch","license":"MIT","author":{"name":"BOOM Events","email":"dev@boomevents.org"},"type":"module","sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/boomeventsorg/boom-sdk.git"},"homepage":"https://github.com/boomeventsorg/boom-sdk#readme","bugs":{"url":"https://github.com/boomeventsorg/boom-sdk/issues"},"engines":{"node":">=18"},"main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./storefront":{"import":{"types":"./dist/storefront/index.d.ts","default":"./dist/storefront/index.js"},"require":{"types":"./dist/storefront/index.d.cts","default":"./dist/storefront/index.cjs"}},"./management":{"import":{"types":"./dist/management/index.d.ts","default":"./dist/management/index.js"},"require":{"types":"./dist/management/index.d.cts","default":"./dist/management/index.cjs"}},"./package.json":"./package.json"},"devDependencies":{"@eslint/js":"^9.39.5","@openapitools/openapi-generator-cli":"^2.13.4","@types/node":"^22.10.0","@vitest/coverage-v8":"^3.2.7","eslint":"^9.15.0","prettier":"^3.4.1","rimraf":"^6.0.1","tsup":"^8.3.5","typescript":"^5.7.2","typescript-eslint":"^8.15.0","vitest":"^3.2.7"},"publishConfig":{"access":"public","provenance":true},"keywords":["boom","boomevents","ticketing","sdk","openapi","fetch","astro","nextjs"],"scripts":{"generate":"node scripts/generate.mjs","generate:storefront":"node scripts/generate.mjs --surface=storefront","generate:management":"node scripts/generate.mjs --surface=management","barrels":"node scripts/build-barrels.mjs","build":"tsup","smoke":"node scripts/smoke.mjs","docs:surface":"node scripts/build-api-surface-doc.mjs","typecheck":"tsc --noEmit","lint":"eslint .","lint:fix":"eslint --fix .","format":"prettier --write \"{src/core,scripts,docs}/**/*.{ts,mjs,md}\" \"*.{json,md,ts}\"","format:check":"prettier --check \"{src/core,scripts,docs}/**/*.{ts,mjs,md}\" \"*.{json,md,ts}\"","clean":"rimraf dist src/generated","version":"node scripts/sync-version.mjs && git add src/core/version.ts","test":"vitest run","test:watch":"vitest","test:coverage":"vitest run --coverage"},"_id":"@boomevents/sdk@0.2.0","_integrity":"sha512-jig3396pqFilzgpMPA2mCpO4l+1Yb47g7Mim3lFmYfd/EDsGUPxrOoZEOqWnxSwI18OT0ORtRxlGSy8+YAxCvA==","_resolved":"/tmp/2a47514c26327fc6edd314710ca90a52/boomevents-sdk-0.2.0.tgz","_from":"file:boomevents-sdk-0.2.0.tgz","_nodeVersion":"22.23.2","_npmVersion":"10.9.8","dist":{"integrity":"sha512-jig3396pqFilzgpMPA2mCpO4l+1Yb47g7Mim3lFmYfd/EDsGUPxrOoZEOqWnxSwI18OT0ORtRxlGSy8+YAxCvA==","shasum":"ef824cd85a799bd5b3c1889b5b4f9821694a123a","tarball":"https://registry.npmjs.org/@boomevents/sdk/-/sdk-0.2.0.tgz","fileCount":36,"unpackedSize":1481678,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@boomevents%2fsdk@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAQp8f/TpxkHx/LBYp1WpZpGeiQnFgRcroBs6vu/2RyeAiBQUqoxmWeAUeBBGBg/IWOd9m+4Tm7Qbfw+bV5Tuw1MHA=="}]},"_npmUser":{"name":"boomeventsorg","email":"services@boomevents.org"},"directories":{},"maintainers":[{"name":"boomeventsorg","email":"services@boomevents.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_0.2.0_1786731459651_0.9943945378461472"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-14T17:50:01.382Z","modified":"2026-08-14T18:17:40.151Z","0.1.0":"2026-08-14T17:50:01.731Z","0.2.0":"2026-08-14T18:17:39.832Z"},"bugs":{"url":"https://github.com/boomeventsorg/boom-sdk/issues"},"author":{"name":"BOOM Events","email":"dev@boomevents.org"},"license":"MIT","homepage":"https://github.com/boomeventsorg/boom-sdk#readme","keywords":["boom","boomevents","ticketing","sdk","openapi","fetch","astro","nextjs"],"repository":{"type":"git","url":"git+https://github.com/boomeventsorg/boom-sdk.git"},"description":"TypeScript SDK for the BOOM Organizer Storefront and Organizer Management APIs — generated from OpenAPI, running on fetch","maintainers":[{"name":"boomeventsorg","email":"services@boomevents.org"}],"readme":"<div align=\"center\">\n\n# 🤘 BOOM SDK\n\n**TypeScript client for the BOOM Organizer APIs** — the storefront your customers buy through, and the management API behind it.\n\nGenerated from the platform's OpenAPI documents, running on plain `fetch`, so it works the same in Astro, Next.js, Node, Deno, Bun and Cloudflare Workers.\n\n</div>\n\n---\n\n## Install\n\n```bash\npnpm add @boomevents/sdk\n# or: npm install @boomevents/sdk · yarn add @boomevents/sdk\n```\n\nRequires Node 18+ (or any runtime with a global `fetch`). No `axios`, no Node built-ins, no framework dependency.\n\n## 60 seconds in\n\n```ts\nimport { createStorefrontClient } from '@boomevents/sdk/storefront'\n\nconst boom = createStorefrontClient({\n  apiKey: process.env.BOOM_API_KEY!,\n})\n\nconst result = await boom.events.listEventsV1({\n  currency: 'CZK', // required — see below\n  lang: 'CS',\n  pageSize: 20,\n})\n\nresult.page // the events, each with its products\nresult.actual // current page index — 0-based\nresult.pages\n```\n\nYou never call `/auth/token` yourself: the SDK exchanges your API key for a bearer token on the first request, keeps it, and swaps it for a fresh one if the platform answers 401. The organizer comes from the token too, so no call takes a tenant parameter.\n\n```ts\nboom.tenantId() // organizer the key belongs to, once a token has been issued\n```\n\nManagement works the same way, against its own token endpoint:\n\n```ts\nimport { createManagementClient } from '@boomevents/sdk/management'\n\nconst boom = createManagementClient({\n  apiKey: process.env.BOOM_API_KEY!,\n})\n\nawait boom.events.publishEventV1({\n  eventId,\n  publishRequest: { published: true },\n})\n```\n\nEvery request goes to `https://platform.boomevents.org` unless you say otherwise. `baseUrl` switches gateways, and it takes one of two known hosts rather than a free-form URL — the client sends your API key to whatever it names, so a typo must not be able to hand that key to somebody else:\n\n```ts\nimport { BOOM_DEV_BASE_URL } from '@boomevents/sdk'\n\nconst boom = createStorefrontClient({ apiKey, baseUrl: BOOM_DEV_BASE_URL })\n```\n\nReading it from the environment? `asBoomBaseUrl` narrows a string to a known gateway and returns `null` for anything else.\n\n## Always send `currency`\n\nThe storefront prices everything it returns, so the event endpoints need a currency even though the OpenAPI document lists the parameter among the optional ones. A call without it answers:\n\n```\n400 Bad Request\n{\"InvalidCurrency\": [\"Currency is not valid.\"]}\n```\n\nSo pass it on every call that takes it — and mind the naming, which differs between list and detail:\n\n```ts\nawait boom.events.listEventsV1({ currency: 'CZK', lang: 'CS' })\nawait boom.events.getEventByIdV1({ id, currencyCode: 'CZK', langCode: 'CS' })\n```\n\nThe simplest approach is to bake it into your own data layer once, rather than remembering it at every call site:\n\n```ts\nconst CURRENCY = 'CZK'\nconst LANG = 'CS'\n\nexport const listEvents = (params = {}) =>\n  boom.events.listEventsV1({ currency: CURRENCY, lang: LANG, ...params })\n```\n\n## Pagination is 0-based\n\nThe first page is `pageNumber: 0`, and `actual` reports the 0-based index of the page you got back. URLs are usually nicer 1-based, so convert at the boundary:\n\n```ts\nconst result = await boom.events.listEventsV1({\n  currency: 'CZK',\n  pageNumber: uiPage - 1,\n  pageSize: 20,\n})\n\nresult.hasNextPage\nresult.hasPreviousPage\n```\n\nThe envelope answers both questions itself, so there is no arithmetic to get wrong.\n\n## What's in the box\n\n| Surface        | Import                       | Covers                                                                          |\n| -------------- | ---------------------------- | ------------------------------------------------------------------------------- |\n| **Storefront** | `@boomevents/sdk/storefront` | `events` (list, detail with products) · `orders` (direct order) · `auth`        |\n| **Management** | `@boomevents/sdk/management` | `events` (CRUD, publish, visibility) · `products` (CRUD) · `customers` · `auth` |\n| **Core**       | `@boomevents/sdk`            | client options, error types, `createBoomConfig`, `BOOM_BASE_URL`                |\n\nTwo OpenAPI documents, 7 API classes, 16 operations — see [docs/api-surface.md](docs/api-surface.md).\n\nBoth clients are flat: one document per surface means `boom.events.listEventsV1()`, not a service-then-class hierarchy.\n\n## Why it feels different from raw generated code\n\nThe generated classes are exposed as-is — no domain facade to drift out of sync with the API. What sits around them is the thin layer you'd otherwise write in every project:\n\n- **API key handling.** Exchanged for a token once, reused, re-exchanged on 401. Concurrent calls share one exchange rather than stampeding the auth endpoint.\n- **Real errors.** Non-2xx throws `BoomApiError` with the body already parsed, plus `validationErrors`, `status` and `isNotFound`-style guards.\n- **Retries with backoff.** Idempotent methods only, honouring `Retry-After`, with full jitter.\n- **Timeouts.** Per attempt, composed with any `AbortSignal` you pass in.\n- **Your `fetch`.** Swap it out to add framework caching, tracing or mocks.\n\n## Keep the API key on a server\n\nThe key is long-lived and grants full access to the organizer's data — including placing orders. It belongs in an environment variable on a server, never in client-side JavaScript.\n\nThe bearer token it produces is short-lived, but it can place orders too, so it should not reach the browser either. Both framework guides show the shape that works: your own endpoint holds the key, the browser gets JSON. See [docs/authentication.md](docs/authentication.md).\n\nFor a storefront already built this way, see **`boom-frontend-sdk`** — a layer over this package with Next.js and Astro reference apps, the SDK confined to a single server-only workspace package, and a `verify:no-leak` step that scans the built client bundles for the key, the platform hostname and SDK internals.\n\n## Documentation\n\n|                                                    |                                                      |\n| -------------------------------------------------- | ---------------------------------------------------- |\n| [Getting started](docs/getting-started.md)         | Install, first call, client options in full          |\n| [Authentication](docs/authentication.md)           | API keys, token exchange, where they may live        |\n| [Error handling](docs/error-handling.md)           | `BoomApiError`, validation errors, retries, timeouts |\n| [Recipes](docs/recipes.md)                         | Listing, ordering, publishing, testing               |\n| [Next.js](docs/nextjs.md) / [Astro](docs/astro.md) | Framework wiring                                     |\n| [API surface](docs/api-surface.md)                 | Every API class and operation                        |\n| [Regenerating](docs/regenerating.md)               | Pulling new endpoints from the platform specs        |\n| [Architecture](docs/architecture.md)               | How the layers fit together, and why                 |\n\n## Working on the SDK\n\n```bash\npnpm install\npnpm run generate    # pull both OpenAPI documents -> src/generated\npnpm run barrels     # rebuild the hand-facing surface over them\npnpm run typecheck\npnpm run test\npnpm run build\n```\n\nBoth documents come from `platform.boomevents.org/custom-openapi`.\n\n## Tests\n\n```bash\npnpm run test           # 95 tests, no network\npnpm run test:coverage\npnpm run smoke          # hits the platform — needs BOOM_API_KEY\n```\n\nThe suite covers `src/core`, the hand-written layer where bugs would live, at ~98% statement coverage. Everything runs against an injected `fetch`, so it needs no credentials and no network.\n\n| File                         | What it pins down                                                                                                                                      |\n| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| `api-key.test.ts`            | Token exchanged once, shared between concurrent callers, key sent as a header only, failed exchange not cached                                         |\n| `fetcher.test.ts`            | Retries only idempotent methods, honours `Retry-After`, never replays a stream body, timeouts, signal composition, a caller's cancellation left intact |\n| `errors.test.ts`             | `BoomApiError` fields and guards, body parsing that never throws                                                                                       |\n| `middleware.test.ts`         | Auth header, 401 re-exchange (and when it must not fire), non-2xx becoming `BoomApiError`                                                              |\n| `config.test.ts`             | Option defaults, middleware ordering, refusing a client with no way to authenticate                                                                    |\n| `client.integration.test.ts` | The whole chain against a stubbed `fetch`, through the real generated clients                                                                          |\n| `version.test.ts`            | `SDK_VERSION` matches `package.json`, so the User-Agent never misreports a release                                                                     |\n\n## License\n\n[MIT](LICENSE) © BOOM Events s.r.o.\n","readmeFilename":"README.md"}