Connect the foundation
Connect the owner’s Instagram account, receive signed comments and save automations. Eligible private replies run only after activation. The separate local preview never sends messages.
Add PostgreSQL
Use a dedicated Supabase development project. Copy the Session pooler connection string from Connect, then set DATABASE_URL and DIRECT_URL in the root environment file. Prisma manages ordinary PostgreSQL tables in the autoflow schema. No Supabase Auth or browser database client is used.
Provision the operator
Set BETTER_AUTH_SECRET and OWNER_EMAIL. After npm run db:deploy, temporarily set OWNER_PASSWORD and run npm run owner:create. Remove the temporary password and restart the API. Customer registration requires configured verification email delivery.
Prepare customer onboarding
Configure Resend email delivery, Google OAuth and the Meta Unified Login configuration. Register the website /api/auth/callback/google with Google and /api/instagram/oauth/callback with Meta. Store the independent token-encryption key and provider secrets only on the API. Customer signup and connections show setup-required states until these are configured.
Check the Instagram account
The backend uses Unified Login at graph.facebook.com. Set META_INSTAGRAM_ACCESS_TOKEN, META_INSTAGRAM_ACCOUNT_ID and META_GRAPH_API_VERSION. Run npm run meta:check or sign in and use Check connection. A profile response proves read access, not send eligibility.
Prepare signed webhooks
Set META_WEBHOOK_VERIFY_TOKEN for the verification GET and META_APP_SECRET for raw-body HMAC verification. These values are different. Signed notifications commit to PostgreSQL before acknowledgement; unavailable persistence returns 503.
Verify real events
Configure the public HTTPS callback and required app/account subscriptions in Meta. Trigger a new eligible comment and check persisted activity. Reply-first flows require messages and messaging_postbacks at both subscription layers. Local parser fixtures do not prove real Meta delivery.
Keep credentials local
Never paste tokens or database URLs into chat, screenshots, frontend environment variables, or the message preview. The repository README includes exact commands.