Reference · 01

SDK reference.

Every public API, with its defaults and failure behavior. Flower is unreleased: APIs and storage formats may still change.

Install the SDK and CLI
npm install @flower-js/sdk
npx flower --help
APIContract
@flower-js/sdkEverything for writing an application: schemas, collections, definitions, components, tasks, access, external values, NaCl and JWT, plus the clients. Safe to bundle.
@flower-js/sdk/clientFlowerClient for calling your methods and FlowerAdmin for operators, from Node or a browser.
@flower-js/sdk/temporalWork queues and expiring records, as components.
@flower-js/sdk/schedulerDelayed callbacks with retries, as a component.
@flower-js/sdk/workerWorker loops for queues and external values: runQueueWorker and reconcile. Node or browser.
@flower-js/sdk/testingAn in-process test database. Node only; keep it out of application bundles.
@flower-js/sdk/cryptoNaCl and JWT, for use inside deployed application code only.
@flower-js/sdk/http2Pooled HTTP/2 transport for the clients. Node only; keep it out of application bundles.
@flower-js/sdk/bundleBuild tools. Node only; keep them out of application bundles.
@flower-js/sdk/package.jsonPackage metadata. Importing internal SDK files isn’t supported.
  • The SDK and CLI need Node 22.18+. The server is a separate Rust binary and doesn’t need Node.
  • npx flower is the SDK’s CLI, not the server. In a checkout, the server is ./target/release/flower. Run npm ci and npm run build first.
  • Source: sdk/ on GitHub.

All reference pages

Values & collectionsWhat a value can be, how collections and indexes work, and incremental totals.Schemas & failuresValidators whose types flow into methods, records and clients, and the structured failures callers receive.Contexts & definitionsWhat a method can do with ctx, and how define builds the public method list.Components & tasksReusable parts for define({ uses }), background work, and reactions to changed rows.Client & transportsFlowerClient for your methods, FlowerAdmin for operators, live values, and the HTTP/2 transport.Queues, expiry & timersJobs leased to one worker at a time, records that expire, and callbacks that run later.External values & workersResults computed outside the database, and the worker loops that keep them current and queues moving.TestingAn in-process database for tests: the same methods, errors and client, with time under your control.Crypto & passkeysHashing, signing, encryption, tokens and passkeys inside your methods.Managed keysDeclare a key in code; an operator provides it. Private key bytes never reach your code.Partitions & transactionsMove tenants between Raft groups, and commit changes across groups at once.Staged deploymentPrepare a new version in the background, switch to it, then clean up.Bundles & CLIBuild app bundles, and deploy, call and watch from the terminal.Authorization & retentionAuthenticate callers, set access per method, and limit how long retry results are kept.Operational limitsThe limits and failure modes your code should plan for.