Install
Runtime config
Server-side composable
Server-only — uses the secret API key. Importable from~/server/api/* and
plugins.
A blog index server route
A blog page
Webhook handler
A composable for client-side public reads
For unauthenticated reads (e.g. public product catalogue), use the public API directly from the browser.Hand this to your AI
“Add aWith/servicespage that lists every active bookable service from Neural Draft. Inserver/api/services.get.ts, callgetNeuralDraft(event).booking.listServices({ status: 'active', page_size: 50 }). In the page component, render each service withdata-translatekeys derived from its slug. For each service, also render the embed snippet returned bynd.booking.getWidget(tenantId, service.id)— gettenantIdonce fromnd.projects.me().”
@neuraldraft/mcp running, the AI will also call
register_component for each section so the customer can edit copy
inline in the admin.
Notes
- Always read raw body in the webhook handler.
readBody()parses JSON and breaks the HMAC; usereadRawBody(). - Public endpoints don’t accept your API key — use
useNeuralDraftPublicdirectly from the browser only for/v1/public/*routes. - For multi-language sites, parameterise
langin your fetches and key your cache by locale.