Skip to main content

Security

App security controls who can access data and use credentials. Check secret storage, row access rules and common mistakes in AI-generated code.

Where should I start with security?

Start with the guide that matches your question or the error you can see. Each guide below names the problem, gives checks you can run, and links to related reading.

What if an API key appears in browser code?

First determine whether the provider explicitly designates the key as public. A VITE_ prefix only changes visibility. If a secret was exposed, treat it as compromised and revoke or rotate it through the provider before repairing the code. Deleting the current line does not remove copies from deployed bundles or version history.

  1. 1Move the secret-dependent action to a server-side handler.
  2. 2Authenticate the caller, validate input and limit what the handler can do.
  3. 3Check built browser assets and error logs for accidental exposure without copying secrets into reports.

Does hiding a Pro button protect paid content?

No. If the answer or paid lesson is already in downloaded JavaScript, hiding it on screen does not prevent retrieval. A protected server read must check current entitlement before returning content. Similarly, an account should not gain access to another user's record simply by changing an identifier in a request. Test these denial paths in isolation.

Read the security guides

9 min readUpdated September 22, 2026

Row Level Security explained

What Row Level Security is, why it is on by default in hosted databases, how a policy is evaluated, and the mistakes that make tables silently empty or dangerously open.

7 min readUpdated September 22, 2026

How to keep API keys out of your frontend

A practical method for moving secret-using code to the server, checking what actually shipped to the browser, and proving a key is no longer exposed.

Looking for something else? Browse every topic.