Skip to main content

A good SDK gives app code a small surface and keeps Bitfield setup work outside app code. The public surface should stay narrow because the setup work is already packaged away.

The JavaScript Runtime Kit is the example. App code gets one read hook and one request function. Bitfield still handles boot, connection, package loading, storage readers, subscriptions, and validation outside that surface.A team wants the same package-backed feature to work from React today and a different app surface later. The SDK should preserve the same read/request shape instead of making every app call setup steps.
App

Read named data. Send a named request. Render product states.

SDK

Connects, subscribes, decodes, retries, and keeps setup details out of app code.

Bitfield

Packages, data names, targets, local state, and runtime/device access stay outside app code.

The rule

Expose the read or request the app actually needs. Do not expose the setup steps Bitfield had to take to make that possible.
Expose reads. Give app code a stable way to receive data, loading, and error.
Expose requests. Give app code a stable way to send a target plus payload.
Hide setup work. Keep boot, package binding, storage addressing, byte subscriptions, and transport setup outside the app surface.

A public surface can be small

export { sendRequestToBitfieldTarget } from './request-surface';
export { useBitfieldData } from './react-surface';
That is enough for most app code. If you need a Swift, Kotlin, Python, or server-side surface later, keep the same shape: one way to read named data and one way to send a request.

The setup surface can be large

The setup surface can do real work. It may connect to Bitfield, load packages, prepare read scopes, subscribe to updates, decode payloads, validate package files, or recover from resets.That does not mean the app surface should expose those details. App developers should not have to call setup code just to render data.

The boundary test

Ask this before adding a public SDK function:
Would an app developer call this because their product needs it, or because Bitfield setup needed a place to live?
If it is setup work, keep it outside the public app surface.

Common failures

SymptomCauseFix
App code has to call three setup functions before reading dataThe setup seam leaked into the app surfaceMove setup into the SDK entry point
SDK exposes raw package materialThe SDK is making app code understand package admissionExpose named data reads and named requests instead
Another language SDK has different product conceptsThe SDK copied implementation details instead of the public shapeKeep every SDK around read, request, state, and error
Error handling is different on every screenThe SDK does not have a stable error contractReturn consistent loading, error, empty, and success states

Verify

The SDK boundary is right when app code can render a surface with one read call and one request call while setup work stays invisible to the product component.

Next

Use App surfaces to design the caller shape and Runtime Kit API for the exact JavaScript public surface.
Last modified on May 11, 2026