Installation
Install keypal and the database client for your storage adapter.
Install keypal
npm install keypalpnpm add keypalyarn add keypalbun add keypalnub add keypalaube add keypalkeypal hashes with node:crypto, so it runs on Node.js, Bun, and other runtimes that provide that module. Its only runtime dependency is nanoid.
Add your storage client
The core package has no storage dependencies. Each adapter has its own import path, and the database client it uses is an optional peer dependency: install the one you use and skip the rest.
| Storage | Import | Also install |
|---|---|---|
| Memory | keypal (the default) or keypal/memory |
nothing |
| Redis | storage: 'redis', or RedisStore from keypal/redis |
ioredis (5 or 6) |
| Drizzle | DrizzleStore from keypal/drizzle, schema from keypal/drizzle/schema |
drizzle-orm |
| Kysely | KyselyStore from keypal/kysely |
kysely |
| Prisma | PrismaStore from keypal/prisma |
@prisma/client |
For example, to keep keys in Redis:
npm install keypal ioredispnpm add keypal ioredisyarn add keypal ioredisbun add keypal ioredisnub add keypal ioredisaube add keypal ioredisThe SQL adapters also need the driver for your database, such as pg for PostgreSQL. Each storage page lists what to install and the table to create.
Next
Follow the quick start to create a key and verify a request.