BrandApp SDK Developer Resources
Everything published by BrandApp Playground for building against @reopt-ai/brandapp-sdk — API reference, OpenAPI description, authentication documentation, webhook verification, and the runnable examples behind each one. New here? Start with the Quick Start.
Machine-readable resources
- BrandApp Playground OpenAPI description
/openapi.json— OpenAPI 3.1 — every route, its security scheme, and the OAuth scopes it needs - llms.txt documentation index
/llms.txt— When to use this site, plus every document with a one-line summary - Full documentation, single file
/llms-full.txt— Every document concatenated, for agents that read once - API catalog (RFC 9727)
/.well-known/api-catalog— Linkset pointing at the description, the docs, and the publisher - Route inventory
/sitemap.xml— Every indexable route on this deployment
Every page also has a Markdown twin: append .md to any route, or send Accept: text/markdown.
SDK documentation by topic
Each page pairs a running demo with the source that produced it.
BrandApp connection
- Connection Swap the BrandApp credentials this deployment uses, stored in an encrypted httpOnly cookie. .md
- Health Check Streams a non-destructive probe suite over SSE against whichever BrandApp is currently wired. .md
Auth and session
- Authentication Better Auth wired to Reopt OAuth — server setup, client setup, session reads, and the catch-all route. .md
- Verify session Validate a `.reopt.ai` subdomain cookie session from a server component with getSessionFromCookies / verifySession. .md
- Machine credentials Server-to-server auth without a shared secret — private_key_jwt assertions, DPoP-bound tokens, a published JWKS, and a dedicated adapter client. .md
- Single Logout OIDC back-channel logout receiver and RP-initiated logout, verified with zero-dependency Web Crypto Ed25519. .md
EAV
- EAV Overview Entry point for the Entity-Attribute-Value store: entities, records, schema, migrations, coercion, typed access. .md
- Entities List EAV entities and resolve their attribute definitions from a React Server Component. .md
- Records Full EAV CRUD against a data grid, using the Server Component + Client Component split. .md
- Filter Builder Compose AttributeFilter entries interactively and read back the equivalent where() DSL snippet. .md
- Schema Definition Declare entities and attributes in TypeScript, then generate types from the declaration. .md
- Schema Sync Run the CLI's sync code path against the in-memory dev server and watch the compatibility report. .md
- Migrations Data-aware schema migrations for changes that must move record values, not just reshape the schema. .md
- Type Coercion Eight helpers that pull typed values out of an EAV record's Record<string, unknown>. .md
- Typed Client Compile-time safe EAV access with TypedEavRecord and the generated ENTITY_IDS constants. .md
AI
- AI Overview Text and image generation billed against the BrandApp's AI credit pool. .md
- Text Completion Streaming (SSE) and non-streaming text generation, with usage metadata on both paths. .md
- Image Generation Prompt-based image generation with optional style and aspect ratio, reporting credit cost. .md
- AI SDK Provider Use generateText / streamText from the Vercel AI SDK against BrandApp via createBrandappProvider(). .md
- Credits and Models Read the AI credit balance and the available model catalog in parallel from a Server Component. .md
CMS
- CMS Overview Read-only content APIs — posts, post groups, and tags — with authoring handled in Reopt Studio. .md
- Posts List and fetch posts, including the slug-addressed detail route with generateMetadata. .md
- Post Groups Resolve group metadata and filter posts by group; authoring lives in Reopt Studio. .md
- Tags Enumerate the tags in use across the brand scope with sdk.cms.tags.list. .md
- SEO, Sitemap, and RSS Turn CMS posts into a Next.js sitemap, an RSS feed, and per-post metadata with the SDK helpers. .md
Files
- Files API Upload, list, and delete files, with the initial listing fetched server-side. .md
- File Browser A complete file manager UI — nested folders, upload queue, rename, move, preview, usage — on the Files API. .md
Terms and billing
- Terms and Consents List active agreements app-scoped, then record and withdraw a signed-in user's consent. .md
- Plans and Checkout Plan catalog, hosted checkout, entitlement verification, and subscription cancellation. .md
React hooks
- React Hooks Overview TanStack Query hooks for every module, with cache keys and invalidation already wired. .md
- EAV Hooks Query and mutation hooks for EAV records, each invalidating the records cache after a write. .md
- AI Hooks Credit balance querying and streaming text generation with observable state transitions. .md
- CMS Hooks Read-only query hooks for posts, post groups, and tags. .md
- File Hooks File listing, uploads, folders, and storage usage as TanStack Query hooks. .md
Integration
- Webhooks Signed webhook handling with replay protection, exercised by an in-browser HMAC simulator. .md
- Dev Server An in-memory BrandApp API on port 4300 so the whole SDK surface works offline. .md
- Testing Utilities In-memory SDKs, a real HTTP test server, and typed fixtures for fast offline tests. .md
- Error Handling The SDK error hierarchy, the diagnostic payload, and how to map errors onto HTTP responses. .md
Authentication model
This deployment is an OAuth relying party, not an authorization server. Sign-in is delegated to Reopt ID, whose authorization server metadata is published at id.reopt.ai/.well-known/openid-configuration. App-scoped calls use BrandApp Client Credentials over Basic Auth; user-scoped calls forward the signed-in user's access token. The OpenAPI description names which of the two each route uses and the scopes it requires — see Authentication for the working setup.
Package
@reopt-ai/brandapp-sdk is MIT licensed and published on the public npm registry — no registry authentication token required. The playground's own source lives at https://github.com/reopt-ai/brandapp-playground.