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
Point your agent at the machine-readable docs: llms.txt is the page index, and llms-full.txt is the full-text dump. Load those first, then use the starter prompt below.
Prime your agent
Drop this into your agent's context before you ask it to build a native feature.
The patterns to follow
A handful of rules keep generated code correct.
- Subscribe before you call. Interactive features (camera, pickers, biometrics, purchases) deliver their result on an event, not the returned promise.
await bdk.ready(...)before branching onbdk.isNative(). Device info arrives shortly after load, so a page-loadisNative()check takes the web path even inside the app.bdk.environment()for an instant answer."native"is trustworthy at first tick on current app builds; treat"unknown"as "wait" and useready(). UX only — never auth.- Branch on
!result.triggered. Outside the native app a call doesn't run — handle that path so your web build keeps working. - Keep server code on the server.
@bdk/native/server/*runs on your backend with your credentials; never import it into a browser bundle.
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.