Installation
Requirements
- Node.js 22.12 or later. We recommend the current LTS release. Dotpress is tested on Node.js 22, 24 and 26. With Node.js 22.18 or later, Node.js runs TypeScript files directly, without a build step: the examples of this documentation use it.
- TypeScript, with
strictenabled. The packages are tested with TypeScript 6. - Zod 4, for the schemas.
The packages are ES modules. A CommonJS project can still load them with require(), which Node.js 22.12 supports for ES modules.
Install the core and an adapter
Dotpress runs on the HTTP server of your choice: install the core, the adapter of your server, the server itself and Zod.
Express
Fastify
Hono
Not sure which one to pick? Your routes do not depend on it, and you can switch later: see Choosing an adapter. For AWS Lambda, see the Lambda adapter.
Configure TypeScript
A configuration for Node.js 22.18 or later, which runs the .ts files directly:
Node.js only strips the types: erasableSyntaxOnly rejects the TypeScript syntax it cannot strip (enums, parameter properties), and relative imports end with .ts. Set "type": "module" in package.json.
If you compile your code with tsc or a bundler instead, keep strict: true and use your usual settings.
Add packages
Each package is optional. Install it when you need it:
Install @dotpress/auth with the alpha tag. Without a tag, npm installs @dotpress/auth 1.x, the plugin of Dotpress 1.
Start from an example
Each example is a complete project, with its tests, that you can copy: