Blitz.js Documentation - Fullstack Toolkit for Next.js

website·Indexed Apr 12, 2026

https://blitzjs.com/

Blitz.js is a fullstack toolkit for Next.js featuring a typesafe API layer, built-in authentication, and code generation. It follows convention over configuration to enable rapid development for monoliths and microservices. Documentation covers installation, the learning path, database setup with Prisma and Postgres, testing with Vitest and Cypress, middleware, and deployment via Flightcontrol. Includes guides for upgrading to Blitz 2.0, integrating with Next.js 13, and contributing to the community.

Tokens
11.5K
Snippets
20
Records
124
Agent score
50%

What's inside Blitz.js

  1. Default Authentication Setup in New Blitz Apps

    New Blitz applications include authentication and authorization out of the box with user sign-up, log-in, and log-out functionality. The User and Session models are defined in db/schema.prisma, while auth logic resides in the src/auth/ folder. Blitz's built-in session management supports both email/password authentication and any third-party providers, following the same approach as the SuperTokens library.
  2. Typesafe RPC data layer eliminates traditional API architecture

    Blitz uses RPC (Remote Procedure Call) as an alternative to REST or GraphQL. You import server code directly into the frontend, and at build time Blitz automatically inserts an RPC API call that runs the code on the server. This abstracts your API into a compile step, eliminating the need to build a separate API layer. You can still use REST or GraphQL if preferred.
  3. Join the Blitz.js community

    Connect via Discord at discord.blitzjs.com for real-time help and collaboration. Use GitHub discussions for longer-form questions. Report bugs by opening an issue at github.com/blitz-js/blitz/issues/new/choose. Read the contributing guide to learn how to submit code, documentation, or other contributions.
  4. Contributing to Blitz.js: Getting Started

    New contributors should: 1) Review 'How to Contribute to an Open Source Project on GitHub' course, 2) Read the Code of Conduct, 3) Learn how the community operates. After contributing, add yourself as a contributor via the @all-contributors bot.
  5. Contact for Code of Conduct Questions

    For questions or feedback about the Code of Conduct, contact Brandon Bayer via Twitter or email.
  6. Default Authentication in New Blitz Apps

    New Blitz apps include authentication and authorization by default with user sign-up, log-in, and log-out. The db/schema.prisma file defines User and Session models, and auth code resides in the src/auth/ folder. Blitz's built-in session management supports email/password auth and third-party providers, following the same approach as the SuperTokens library.
  7. Server Utilities Overview

    Blitz resolver utilities are exported under the resolver object (not resolverPipe/resolverZod) for cleaner imports and discoverability. Resolvers are functions that transform input to output, separate from raw API handlers. They run on the server and can use middleware context for session, database, and authorization.
  8. Blitz extends Next.js with fullstack features

    Blitz builds on Next.js by adding missing fullstack features including a typesafe API layer, middleware, and authentication. This allows you to build a complete fullstack Next.js application without assembling separate libraries.
  9. Blitz Recipes overview

    Blitz Recipes are predefined formulas for adding npm dependencies or other code to your application. They automate complex multi-step setup that would otherwise require looking up integration examples. Inspired by Gatsby Recipes, they replace the need for manually following Next.js examples. Recipes are unversioned and pulled directly from GitHub, so updates are available immediately after being merged.
  10. Prohibited Behaviors

    Do not: discriminate; engage in sexism, racism, or harassment (including offensive comments about protected characteristics, sexual images in public spaces, deliberate intimidation, stalking, or unwelcome sexual attention); use overtly sexual or distracting nicknames on Discord; use profanity that may offend; derail discussions or engage in tone arguments; spam, troll, flame, or bait; or engage in unstructured critique. Sponsors must also comply and avoid sexualized imagery.
  11. Client Plugins overview

    Client Plugins extend the Blitz toolkit with custom functionality using the createClientPlugin function from the blitz package. A plugin can return: events for event hooks executed in parallel, middleware for hooks executed in series through pipes, withProvider to wrap the root component via withBlitz, and exports to expose functions or variables importable from src/blitz-client.
  12. Route Manifest provides type-safe page routing

    Blitz includes a Route Manifest for type-safe routing. Instead of manual string paths like /products/${123}, use Routes.ProductsPage({ productId: 123 }). This improves expressiveness and simplifies refactoring when pages move to different locations. See the Route Manifest documentation for details.