Connect a service to your app
IntermediateMost real apps need a secret or two — an OpenAI key to call a model, your Supabase URL and keys to reach a database. bychat keeps these as environment variables, set per project (and per branch), encrypted, and never shown back once saved. This guide covers the three ways to provide them: connecting a known service, pasting a .env file, and adding a single variable by hand.
Connections: the fastest way
Open your app, go to the Cloud tab, and click Connect. A searchable picker lists known services — OpenAI and Supabase today. Pick one and a short form asks for just that service's fields with plain labels (OpenAI: an API key; Supabase: project URL, anon key, and service-role key). Fill them in and click Connect — bychat creates the right environment variables under the hood (for example OPENAI_API_KEY, or VITE_SUPABASE_URL / VITE_SUPABASE_ANON_KEY / SUPABASE_SERVICE_ROLE_KEY) and stages the values. Click Save changes to deploy.
Paste a .env file
Already have a .env from another project or a service's dashboard? Click Paste .env and drop the KEY=value lines in. Keys your repo already declares are filled in; keys it doesn't are added as your own variables. Nothing deploys until you click Save changes, so you can review everything first.
Add a single variable
To wire up one key your repo's .env.example never declared, click Add variable, type the name and value, and choose whether it's a secret (encrypted, masked) and whether it's build-time (baked into the bundle, which triggers a rebuild) or runtime (read live, refreshed without a rebuild). bychat guesses these from the name — keys like API_KEY or TOKEN default to secret; names starting with VITE_ or NEXT_PUBLIC_ default to build-time — and you can override before saving.
Secrets, build-time, and sharing
Secret values are stored encrypted and are write-only: the editor shows that a value is set and when it changed, but never the bytes. Build-time variables (VITE_*, NEXT_PUBLIC_* and similar) are compiled into your app, so changing one rebuilds it; runtime variables refresh the live preview without a rebuild. If you share a project, connections you set up stay yours by default — a per-collaborator sharing option for connections is on the roadmap.