Neon RLS (now part of the Neon Data API) simplifies Postgres row-level security by integrating JWT-based authentication directly with the database. Developers can define declarative access rules at the database level instead of scattering authorization logic across application code. The tool supports any auth provider that issues JWTs (Clerk, Auth0, AWS Cognito, Firebase, etc.) and partners with Drizzle ORM to let developers write RLS policies alongside their schema definitions using a cleaner API. A pg_session_jwt open-source extension provides utility functions like auth.user_id() and auth.session() for use in RLS policies. The approach enables serverless, client-only apps by pushing authorization into the database layer, though complex access logic is still recommended to live in backend code.

6m read timeFrom neon.com
Post cover image
Table of contents
Expanding access to RLSThe elephant in the room: RLS’s SQL syntaxGet started with Neon RLS + Drizzle + ClerkWrapping UpRLS for everything or not?