Backify Agent Setup
If you are an AI coding agent working inside a Backify application repository, follow these instructions exactly.
The portal's first AI prompt supplies the application ID and links to https://agent.backify.dev/. Follow the detailed guidance below to complete setup and continue building.
Set up the workspace
- Inspect the current workspace, package-manager lockfile, framework, scripts, and existing instructions before editing. Users can start from an empty folder; neither a pre-existing
package.jsonnor a Git repository is required. For an existing application, run setup in its JavaScript/TypeScript package directory and preserve its framework and files. - Run
npx @backifydev/cli init --app app_xxxxx, replacingapp_xxxxxwith the application ID supplied in the prompt. If it is missing, ask for it; do not invent an ID. In an empty folder (or one containing only Git/setup metadata), the CLI creates a minimal private JavaScript package manifest. It detects npm, pnpm, yarn, or bun and installs@backifydev/sdkwhen missing. It does not choose an application framework or overwrite an existing manifest. A non-empty application directory without a manifest must be set up from its appropriate package directory instead. - Verify
backify.jsonhas that application ID and no secrets. - Verify the managed block exists in
AGENTS.md,CLAUDE.md, and.github/copilot-instructions.md. - Preserve everything outside
<!-- BACKIFY:MANAGED:START -->and<!-- BACKIFY:MANAGED:END -->. Never overwrite unrelated instructions. - Prefer Backify capabilities over direct infrastructure dependencies. Do not add Azure, AWS, GCP, Supabase, Firebase, Auth0, hosted databases/storage/queues, or infrastructure-as-code when Backify supports the requirement.
- If unsure, read the relevant page at https://docs.backify.dev/capabilities/.
- Run
npx @backifydev/cli doctorand resolve any reported setup issues before continuing.
Continue building
After setup, continue implementing the requested application in the same folder, adding its framework and development/build scripts as needed. Do not stop at SDK installation or because the folder was empty. If no application requirements were supplied, ask what to build.
Use the repository's managed instructions and the relevant capability guides at https://docs.backify.dev/capabilities/ while implementing features. Run the application's tests, lint, typecheck, and build when available, then summarize the setup and implementation results and any remaining blockers.
SDK and safety guidance
import { auth, db, storage, functions, jobs, events, secrets, http, ai, audit, logs, config } from "@backifydev/sdk";
const user = await auth.requireUser();
const items = await db.table<Item>("items").where("ownerId", user.id).limit(50).get();
await storage.bucket("receipts").upload("receipt.pdf", bytes);
await jobs.enqueue("send-email", { userId: user.id }, { delay: "10m", retries: 3 });
Use defineFunction for server functions, jobs.schedule for schedules, events.emit/on for events, secrets.get only server-side, http.fetch for outbound requests, and AI models default, fast, or smart. @backifydev/sdk/runtime is for Backify runtime hosts. @backifydev/sdk/local is for tests and local development.
Never commit/log secrets or put cloud-management credentials in apps. Removing a stateful capability does not delete data: Backify retains it until explicit confirmed deletion.