Use sendRequestToBitfieldTarget(...) when app code needs to ask a named Bitfield target to do work.
What this is
A target is a public callable name. Your app sends a payload to that name. Runtime Kit routes the payload to the package code registered for that target. Your app receives reply bytes.The mental model
Your app should not care how the work is performed. It should care about the public action name and the payload it sends.If a user clicks a search button, your app can callproduct.search. The package behind that target can change later. Your button can stay the same as long as the action reply shape stays the same.That is the value: app code calls the public target name, not the private implementation.How it works technically
read
useBitfieldData(...) reads values already prepared for the surface.
act
sendRequestToBitfieldTarget(...) sends bytes to a named target.
reply
The app decodes only what the action reply shape promises.
Send JSON-like data
Send text
Send bytes
payload is already a Uint8Array, Runtime Kit sends those bytes.Understand payload encoding
The target decides what those bytes mean. Your app and target should agree on a public contract, such as JSON in and JSON out.If a target needs JSON with a
null value, send an object that contains the null field:Decode the reply
The reply is always bytes because targets are not forced into one format.Uint8Array:Cancel a request
Use anAbortController when the user leaves a screen, changes a search query, or cancels work.Handle errors
Wrap user-triggered requests so the UI can recover.Before / after
Common mistakes
Using target names as storage addressesproduct.search is a callable target name. It is not a storage path.Parsing every reply the same wayThe reply is bytes. Decode according to the action reply shape. Do not assume every target returns JSON unless that target says it does.Calling private implementation code directlyIf a component imports the target implementation, the request boundary has been bypassed.Forgetting cancellationSearch boxes, typeahead, and long tasks should use an abort signal so stale work can stop.