Install the SDK and CLI
npm install @flower-js/sdk
npx flower --help| API | Contract |
|---|---|
@flower-js/sdk | Everything for writing an application: schemas, collections, definitions, components, tasks, access, external values, NaCl and JWT, plus the clients. Safe to bundle. |
@flower-js/sdk/client | FlowerClient for calling your methods and FlowerAdmin for operators, from Node or a browser. |
@flower-js/sdk/temporal | Work queues and expiring records, as components. |
@flower-js/sdk/scheduler | Delayed callbacks with retries, as a component. |
@flower-js/sdk/worker | Worker loops for queues and external values: runQueueWorker and reconcile. Node or browser. |
@flower-js/sdk/testing | An in-process test database. Node only; keep it out of application bundles. |
@flower-js/sdk/crypto | NaCl and JWT, for use inside deployed application code only. |
@flower-js/sdk/http2 | Pooled HTTP/2 transport for the clients. Node only; keep it out of application bundles. |
@flower-js/sdk/bundle | Build tools. Node only; keep them out of application bundles. |
@flower-js/sdk/package.json | Package 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 floweris the SDK’s CLI, not the server. In a checkout, the server is./target/release/flower. Runnpm ciandnpm run buildfirst.- 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.