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 · React

Render public Casset data in React.

Load /connor, show an honest empty state, and keep the same typed client underneath.

Render /connor

App.tsxtsx
import { createCassetClient } from "@casset/apps"
import {
  CassetClientProvider,
  useCassetArtist,
  useCassetCatalog,
} from "@casset/react"

const client = createCassetClient({
  baseUrl: "http://127.0.0.1:3000",
})

function ConnorPage() {
  const artist = useCassetArtist("connor")
  const catalog = useCassetCatalog("connor")

  if (artist.status === "idle" || artist.status === "loading") {
    return <p>Loading Connor…</p>
  }
  if (artist.status === "error") throw artist.error
  if (catalog.status === "idle" || catalog.status === "loading") {
    return <p>Loading the Catalog…</p>
  }
  if (catalog.status === "error") throw catalog.error

  return (
    <main>
      <h1>{artist.data.artist.displayName}</h1>
      {catalog.data.tracks.length === 0 ? (
        <p>No public Tracks yet.</p>
      ) : (
        catalog.data.tracks.map((track, index) => (
          <p key={track.kind + "-" + track.title + "-" + index}>{track.title}</p>
        ))
      )}
    </main>
  )
}

export function App() {
  return (
    <CassetClientProvider client={client}>
      <ConnorPage />
    </CassetClientProvider>
  )
}

Version 0.2.0-alpha.0 is repository-local and vendored into the generated Headless starter. It is not published to npm. Public HTTP examples use a local Casset origin because the deployed public v1 routes are not supported for production use and may intentionally fail closed with 503 ResourceUnavailable. The two public GET routes require no credential; production developer credentials remain unavailable.

React is optional

Use the framework-neutral client on a server, in another UI framework, or in a background tool. Add this adapter only when React should own query presentation—not transport behavior.

Exact exports

@casset/react exports
ExportPurposeBoundary
CassetClientProviderProvides one existing CassetClient.Does not create or configure a client.
useCassetClient()Reads that client.Throws if the provider is missing.
useCassetArtist(handle)Loads and shares public Artist state by client and handle.Returns idle, loading, ready, or error plus reload().
useCassetCatalog(handle)Loads and shares public Catalog state by client and handle.Uses the exact Catalog response; no pagination or filtering is added.
CassetHostProviderProvides a Native App host.Native Apps only; unrelated to Headless HTTP.
useCassetHostSnapshot()Reads the host-owned Native App snapshot.Creates no playback authority.
CassetQueryResult / CassetQuerySnapshotTyped query-state unions.The success state is named ready, not success.

Query behavior

  • Stores are shared per CassetClient instance and handle.
  • An initial effect starts loading; a ready result is reused.
  • reload() forces a new generation, and the newest generation wins.
  • Errors remain the SDK's typed errors or an ordinary unexpected Error.
  • The adapter does not add caching headers, retries, credentials, endpoint paths, or response fields.

Availability and credentials

Public v1 uses no credential. The local sandbox requires a Bearer value, but that value belongs in the starter's development proxy or another server-side boundary—not in a React prop, context, browser bundle, or log.

See the core SDK, typed errors, and interactive documentation fixture.

© Casset 2026
Trust & PrivacyTerms