PreviewLatch docs
PreviewLatch locks a website behind a login so only the people you invite can see it. It is for preview deployments, staging sites, client projects and private tools.
The pieces
- The middleware, the
previewlatchpackage on npm. It runs in your site's own server, in front of every request. It is open source (MIT) and has no runtime dependencies. Next.js is supported today; adapters for other frameworks are planned. - The dashboard, hosted by us. This is where you add sites, people and passwords, see who is signed in, and take access away.
In one minute
- Create a site in the dashboard and copy its site key. It is shown once.
- Put the key in your site's environment as
PREVIEWLATCH_KEY, install the package and add one file. See the quick start. - Add people and create a password for each: reusable, one-time, or expiring. Send it to them however you like.
- Anyone without a valid session gets a login screen and nothing else. When you revoke someone, it reaches your site within the recheck interval, 60 seconds by default.
Read next
- Quick start: install, options, and checking it works.
- How it works: the login flow, the cookie, revocation and what happens during an outage.
- Site keys and rotation: what the key is and how to replace it without signing people out.
- What it does not protect: read this before you rely on it.