Password Generator Template
- Next.js
- TypeScript
Generate strong passwords and passphrases, then check how strong any password is before you use it.
A Next.js app that makes strong passwords. Choose random passwords or readable passphrases, set the length and character sets, and get five at a time with one-click copy. A strength check scores any password and shows what it has and what it lacks. Use it as a standalone tool, or lift the route to suggest passwords on your own sign-up form.

What it does
- Passwords or passphrases
- Random passwords from 8 to 64 characters, or passphrases of 3 to 8 capitalized words you can actually remember.
- Your character rules
- Toggle uppercase, numbers and symbols, and leave out look-alikes such as l, 1 and O, 0.
- Strength check
- Scores any password on a five-step meter with a checklist of length, character mix, runs and repeats.
- Never caches a password
- Generated passwords are never cached, and strength answers are cached under a SHA-256 hash rather than the password.
- Keeps your key private
- The browser only talks to your own API route, which holds the key and limits each visitor to 10 requests a minute.
How it works
The strength check: cached by hash, then guarded, then one call to Password Strength.
if (mode === 'check') {
const password = str(params.get('password'), 128);
if (!password) return fail('Enter a password to check');
const key = `check:${createHash('sha256').update(password).digest('hex')}`;
const hit = fromCache(key, TTL_MS);
if (hit) return Response.json(hit);
const blocked = guard(request);
if (blocked) return blocked;
return respond(async () => {
const data = await callApi('passwordstrength', { query: { password } });
toCache(key, data);
return data;
});
}Deploy it
- Get a free API key
The free plan includes 200 credits a month, no card needed. Create your key.
- Deploy it
Click Deploy to Vercel. Vercel copies the repo to your GitHub account and asks for
APIVERVE_API_KEY: paste your key there. - Open your app
Vercel builds it and gives you a live URL, usually in about a minute. Every push to the repo redeploys it.
Try the Password Generator API — the call this template makes
No key required to try it. Get a key to use it in your app.
{
"status": "ok",
"error": null,
"data": {
"passwords": [
{
"password": "aOwqDh0ZK*P;!M|%oiFYJ!IK%TMXQO",
"length": 30,
"metadata": {
"type": "random",
"complexity": "strong"
},
"analysis": null
},
{
"password": "Wo:)*V2nMakoVI78[fKu|QDI.E45p|",
"length": 30,
"metadata": {
"type": "random",
"complexity": "strong"
},
"analysis": null
},
{
"password": "%XqlsK2qN.9>*&jk6gYIG.[aE,hiRc",
"length": 30,
"metadata": {
"type": "random",
"complexity": "strong"
},
"analysis": null
},
{
"password": "WQNY0{R~(G99uc&i62Mve).n<|xt=F",
"length": 30,
"metadata": {
"type": "random",
"complexity": "strong"
},
"analysis": null
},
{
"password": "2$m-&z9!5$c3QlxQP{h#@0x~'M/h]T",
"length": 30,
"metadata": {
"type": "random",
"complexity": "strong"
},
"analysis": null
},
{
"password": "y]e_H)/z2yzbr{4C&hHOb[Q:#/$Hml",
"length": 30,
"metadata": {
"type": "random",
"complexity": "strong"
},
"analysis": null
},
{
"password": "+iZ,<<+_MR:jJ,JbXTN*3Z,xLo'=@E",
"length": 30,
"metadata": {
"type": "random",
"complexity": "strong"
},
"analysis": null
},
{
"password": "x=e6H^U;ajD+)h5Z8$7Wy)^Ob8ERw'",
"length": 30,
"metadata": {
"type": "random",
"complexity": "strong"
},
"analysis": null
},
{
"password": "+p!SGSnR*JNl}/[#oVQy~ZxtoZU}F+",
"length": 30,
"metadata": {
"type": "random",
"complexity": "strong"
},
"analysis": null
},
{
"password": "%h:23-bMb0;?QWL)chKm8{>%)mN:EO",
"length": 30,
"metadata": {
"type": "random",
"complexity": "strong"
},
"analysis": null
}
],
"count": 10
}
}