API key management
API keys grant access to services like Supabase, Stripe, and third-party APIs. Exposing them in your frontend code means anyone can see and misuse them.Store all API keys in environment variables, never in source code
Use server-side API routes to call external services - never make API calls with secret keys from the browser
Use separate API keys for development/staging and production
Rotate API keys immediately if you suspect they’ve been exposed
Review your codebase for hardcoded keys before publishing (search for strings starting with
sk_, key_, or secret)Rocket stores environment variables securely and injects them at build time. They are never exposed in the client-side bundle.
Authentication
If your app has user accounts, protected pages, or personalized content, you need authentication.Enable authentication for any page that shows user-specific data
Protect all API routes that create, update, or delete data
Implement sign-up, log-in, and password reset flows
Use secure session management (Rocket + Supabase handle this by default)
Add email verification for new accounts when possible
Redirect unauthenticated users to the login page instead of showing empty states
Row-level security (RLS)
If you’re using Supabase, row-level security ensures users can only access their own data at the database level - even if there’s a bug in your application code.Enable RLS on every Supabase table that stores user data
Create policies that restrict reads and writes to the authenticated user’s own rows
Test policies by trying to access another user’s data (you should get an empty result)
Never use the Supabase
service_role key in client-side code - it bypasses RLS entirelyRLS is the last line of defense. Even if your API has a bug that sends the wrong query, RLS will prevent data leaks at the database level.
Environment variables
Environment variables keep sensitive configuration out of your source code.All secrets (API keys, database URLs, webhook secrets) are stored as environment variables
Environment variables are set in Rocket’s deployment settings, not committed to code
Client-side environment variables (prefixed with
NEXT_PUBLIC_) contain only non-sensitive valuesServer-side environment variables are only accessible from API routes and server components
HTTPS and transport security
Your app is served over HTTPS (Rocket enforces this automatically on all deployments)
External API calls use HTTPS endpoints, not HTTP
WebSocket connections use WSS (secure WebSocket), not WS
Privacy considerations
Only collect user data you actually need
Display a privacy policy that explains what data you collect and how it’s used
Add cookie consent notices if you use analytics or tracking (required in the EU)
Provide a way for users to delete their account and data
Don’t log sensitive information (passwords, full credit card numbers, personal identifiers) in server logs
Security audit prompt
Before each deployment, ask Rocket to run a security check on your app:What’s next?
Add payments
Connect Stripe and handle payments securely.
Launch your site
Test in staging before going live.
Compliance
Accessibility, legal, and regulatory considerations.
Your first task
Build and deploy your first app from scratch.

