Use with AI agents
Point Lovable, Cursor, Replit, and other AI coding tools at the SDK so they generate correct, secure code.
Built for AI agents
Read llms.txt for the page index, then fetch the pages needed for the task. llms-full.txt is for tools that index the full reference.
Prime your agent
Drop this into your agent's context before you ask it to build a native feature.
The patterns to follow
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.
Use one client per page. Detect native UI at startup and wait for device info before platform-dependent calls. Keep keys on the backend; authentication and permission checks belong there too.
Set up the app with your AI
To create, preview, pay for and build the BDK project, follow https://thebdk.com/agent/skill.md. Connection steps: https://thebdk.com/agent. These are service tasks; this docs set covers SDK code.
Keys stay in the environment
Agents copy your examples closely, so every example here reads credentials from the environment. Follow the same rule: pass keys from env (or a secrets manager), never in client code or source.
Server helpers read their credentials from arguments or environment variables. Don't hardcode API keys, and never ship a server import to the browser.