Installation
Two packages — the core SDK and an optional Astro adapter.
npm install @brandfine/client
# Optional, only on Astro projects:
npm install @brandfine/client-astroBoth packages ship to public npm with provenance attestations — installs are verified against this repo's CI runs.
What's in each
@brandfine/client
Framework-agnostic. Works in any environment with fetch
(Node 18+, browser, Bun, Cloudflare Workers, Deno).
| Module | What it exports |
|---|---|
@brandfine/client | createBrandfineClient, BrandfineApiError, all types |
@brandfine/client/cache | createCache, createKeyedCache |
@brandfine/client/resolvers | pickLocale, localizePath, stripLocalePrefix, isLocale, resolveNavigation |
@brandfine/client/webhook | createBrandfineWebhookHandler, verifyWebhookSecret, parseWebhookPayload |
@brandfine/client-astro
Astro adapter. Re-shapes the SDK's Request → Response webhook
handler into Astro's APIRoute shape, plus a readBrandfineEnv()
helper for the import.meta.env / process.env dual-source
quirk.
Versioning
Pre-1.0 (0.x.y) is the unstable phase — minor bumps can
contain breaking changes (per npm's pre-1.0 semver convention).
Pin precisely with ~0.1.0 if you want patches only; use
^0.1.0 to accept all 0.1.x patches automatically.
After 1.0, normal semver applies — breaking changes in major,
additive in minor, fixes in patch.