casset/docs
FeaturesOpen app
docs indexreference
00Overview01Thesis02Architecture03System reality04Roadmap05Investor brief06Technical brief07Full tech HTML08Casset Apps09Headless API10Playback11Audio pipeline12Commerce13Base anchoring14Hook system15Music video16Theming17Creator guide18Glossary
Headless APIDeployed · unsupported
QuickstartExamplesAPI ReferenceSDK
Advanced
React adapterStarter detailsError handlingRetries & timeoutsUse casesRequest IDs & safe loggingAPI versioningLocal sandboxLocal webhooksAvailability & limitationsFAQChangelogDesign principles
Headless API · Local sandbox

Rehearse authorization without pretending it is production.

The sandbox is a loopback-only development host for credential issuance, revocation, public-data reads, idempotency, webhooks, replay, and sanitized inspection.

The sandbox is disabled in production and stores state in the current process. It is not a deployed public base URL, developer account system, durable credential service, or production webhook product.

Loopback only

Requests must target localhost, 127.0.0.1, or::1 in development or test. Remote browser origins and production mode fail closed.

What exists

Local sandbox capabilities
CapabilityBehaviorProduction implication
RegistrationCreates a process-local developer, App, and immutable sandbox version 0.1.0.No external account or submission.
Credential issuanceReveals one plaintext Bearer value once; persists only a hash and nonsecret metadata.No durable production credential.
Public Artist and Catalog readsRequire that active local credential and return the exact public response contracts.No private grants or extra fields.
RevocationTakes effect immediately for later local requests and emits credential.revoked.No production revocation service.
Console actionsRequire Idempotency-Key and store one process-local result.No durable job or audit system.
InspectionShows sanitized request metadata and local lifecycle records.Not a production log stream.

Keep the credential server-side

server.tsts
import { parsePublicArtistResponse } from "@casset/apps"

const credential = process.env.CASSET_SANDBOX_CREDENTIAL
if (!credential) throw new Error("Missing local sandbox credential")

const requestId = "server-sandbox-artist-001"
const response = await fetch("http://127.0.0.1:3000/api/sandbox/v1/artists/connor", {
  headers: {
    accept: "application/json",
    authorization: "Bearer " + credential,
    "x-request-id": requestId,
  },
})

const responseRequestId = response.headers.get("x-request-id")
const body: unknown = await response.json()
if (responseRequestId !== requestId || !response.ok) {
  throw new Error("Casset sandbox request failed")
}

const artist = parsePublicArtistResponse(body)
// Return only artist. Keep credential and diagnostics in this server process.
  • Never use a VITE_, NEXT_PUBLIC_, or other browser-exposed variable.
  • Never log the credential, Authorization header, credential prefix, webhook secret, request or response body, private handle or query string, App ID, database ID, or media URL.
  • Do not return a credential through React props, route JSON, an error, or client inspection.

Issue, use, and revoke

  1. Open the authenticated Developer Portal on a local Casset process.
  2. Register one process-local App.
  3. Issue a credential and copy the plaintext value once.
  4. Place it in the Headless starter's server-only .env.local.
  5. Read /api/sandbox/v1/artists/connor or its Catalog counterpart through the development proxy.
  6. Revoke it and confirm the next read returns 401 INVALID_CREDENTIAL.

Idempotent console actions

  • Idempotency-Key is required and accepts at most 128 text characters.
  • Keys are scoped by console action type. The same key and same action payload replay the stored result; concurrent duplicates coalesce.
  • Reusing a key with a different payload for the same action type returns 409 INVALID_REQUEST. The same text may be used by a different action type because it has a separate scope.
  • Replayed credential and webhook results redact plaintext credentials and signing secrets.

Sanitized inspection

The local console records request ID, method, normalized route template, status, stable error code, and time. Internal process-local relationships may be visible inside the console, but do not copy App IDs or credential prefixes into application logs. Authorization values and request/response bodies stay hidden.

Continue with local webhook rehearsal, safe logging, or the generated starter.

© Casset 2026
Trust & PrivacyTerms