Secrets
Secrets keep private credentials like API keys safe on the server side and out of the browser. Lovable automatically prompts you for them in chat, or you can manage them in your project settings.
Anyone integrating external services like Stripe or OpenAI who needs to store sensitive API keys securely.
Do this, in order
- 1
Prompt Lovable to build a feature that requires a third-party service, asking it to request any needed API keys.
Lovable will open a secure input dialog directly in the chat explaining exactly which key it needs.
- 2
Paste your secret value into the secure prompt and submit, or copy the generated value if it is a shared token.
Secrets are encrypted, write-only, and injected directly into your backend code without exposing them to users.
- 3
To view or update secrets manually, open More → Settings → Secrets in your project toolbar.
This lets you add new secret names, delete obsolete keys, or rotate Lovable-managed keys.
Paste this into your project
Connect Stripe so users can pay for subscriptions. Please ask me for any secret API keys you need through the secure form.
Words decoded
- Edge Functions
- Small backend programs that run securely in the cloud instead of inside the user's web browser.
- VITE_ environment variables
- Configuration settings defined in your .env file that are visible to anyone inspecting your website's code.
- Write-only
- A security setting where a value can be saved or replaced, but never viewed again afterward.
Where people get stuck
- Do not add sensitive credentials like private API keys to your .env file; they will be exposed in the browser bundle.
- Do not add .env to .gitignore in Lovable; the platform requires that file committed to generate app previews.
- Do not expect to read secret values after saving them—they are write-only, so copy generated values before submitting.
- Do not create secrets starting with SUPABASE_ or LOVABLE_, as these prefixes are strictly managed by the system.
The short version, steps, decoder and prompt on this page are written automatically from Lovable's own documentation and can lag or misread it. The official page is always the authority.