Detect features
Check whether a feature is switched on in this app build before you show its UI.
Check one feature
Ask whether this build has a feature switched on. has is true only then — the right check before you show the UI.
Read the full map
Read every feature this build reports — enabled, available, and config per id — plus platform and the app version. Pass timeoutMs to wait that many milliseconds. get resolves null when the answer isn't known: a plain browser, an older app build, or a slow start. null is not off.
Don't treat null as off. Wait for bdk.ready() and call get again.
Interpret the states
enabled, available, and a null map are three different answers.
- Missing from
features, orenabledis nottrue— not in this build. Hide the UI. enabledistrueandavailableisfalse— in this build, but unusable on this device right now.get()returnednull— unknown. Don't treat it as off. Wait forbdk.ready()and try again.
When a feature is off
Legacy commands return NativeCommandResult; use !result.triggered and subscribe before calls whose data arrives on events. A browser tab returns pending, while a runtime without window returns skipped. Envelope helpers return { ok: true, ... } or { ok: false, code, message }; use isBdkError(result) or !result.ok, not triggered. New iap.* and health.* helpers can also return a bare command result: check "ok" in result first. Read each helper’s result type; do not apply one check to all methods.
Return from the action or render the web path when the capability is unavailable. Do not continue into the native call.