Skip to main content

A target is the named action a surface can request. Good targets read like product verbs, accept small payloads, and return a shape the surface can render.

The customer dashboard has an Archive button. The target should be customers.archive, not a generic doThing command with a hidden action string.
Name

Name the action around the user’s intent.

Payload

Pass only what the target needs to do the work.

Reply

Return enough for the surface to show success or failure.

Naming rule

Use a name that tells the caller what business action is being requested.
GoodBadWhy
customers.archivecustomers.commandThe good name says the exact action
rooms.joinroomMutationThe good name is a product verb
invoice.sendrunWorkflowThe good name does not hide intent in payload

Payload rule

The payload should be narrow and explicit. It should carry identity and user intent, not a second command language.
await sendRequestToBitfieldTarget('customers.archive', {
  customerId: 'cus_123',
});
Avoid this shape:
await sendRequestToBitfieldTarget('customers.command', {
  action: 'archive',
  table: 'customers',
  where: 'id = cus_123'
});
The second example makes the surface speak storage and command vocabulary. The action name should carry the action.

Reply rule

Return a result the surface can use.
Reply fieldPurpose
okLets the surface show success or failure
messageLets the surface show human-readable feedback
product id fieldsLets the surface reconcile the specific item
next read nameOptional pointer to the named data read that should refresh
A well-shaped surface sends a named product request, shows a useful outcome, and avoids turning payloads into hidden command strings.

Common failures

SymptomCauseFix
Every button calls the same targetThe target is hiding many actions behind one generic action nameSplit targets by product action
Payloads keep growingThe target boundary is too vagueName the target more narrowly
The surface cannot show resultReply shape is not renderableReturn ok, message, and product ids
The target imports screen placement rulesAction and layout are tangledKeep placement in shell/surface descriptor

Next

Use App surfaces for the caller side and sendRequestToBitfieldTarget for the exact public request function.
Last modified on May 10, 2026