Skip to main content

The public JavaScript Runtime Kit API has one request function and one React read hook. Everything else stays outside app code.

Use this page when you need exact names, shapes, and failure boundaries. If you want to build a first feature, start with Package to screen. If you want copyable recipes, start with Runtime Kit Cookbook.

Public imports

The source guard is packages/js/src/public-surface.test.ts: the root package exports only sendRequestToBitfieldTarget, and the React subpath exports only useBitfieldData.

sendRequestToBitfieldTarget(...)

This function sends one payload to one named target and returns reply bytes.

Request type

Payload conversion

Reply type

Cancellation

Pass an AbortSignal as the second argument when the request is tied to a UI lifetime or a changing user input.
Runtime Kit passes the signal to the target transport. App code should still render a recoverable state because the user action may already have left the screen.

Complete valid example

This is valid because the app calls the public action name, sends a target-owned JSON payload, and decodes the reply according to the target’s documented contract.

Invalid example

This is invalid because the app imports the target implementation. The public files and names is the action name plus bytes. Direct implementation imports make the app depend on how the target is built.

Error categories

useBitfieldData(...)

This hook reads named data for a React surface. A data name is a public name that Runtime Kit already resolved behind the surface. It is not a storage path.

Selector forms

Return state

Complete valid example

This is valid because the component asks for a data name by name and renders every public state: loading, error, empty, and ready.

Invalid example

This is invalid because React code imports private machinery and guesses a storage address. The surface should ask for the data name.

Boundary summary

Last modified on May 10, 2026