NestJS Authentication
Token verification, guarded routes, roles, and API tokens for your NestJS API. Paste one prompt into your AI agent, or wire it yourself with one module import.
Add auth to my NestJS API using The Bridge.
Your NestJS API, wired in
- One module importBridgeModule.forRoot({ appId }) wires verification into your app.
- Routes guarded by defaultThe global BridgeAuthGuard protects everything; @Public() marks the exceptions.
- The user by decorator@CurrentUser() hands any controller the verified user.
- Machines welcome tooScripted callers authenticate with revocable API tokens.
Auth by asking.
The Bridge is agent-native. Install the Bridge CLI, paste one prompt, and your coding agent wires authentication into your NestJS API.
Your agent does the wiring, you ship the product
Install the Bridge CLI, then paste the prompt below into your agent. It authorizes the CLI in your browser (creating your account right there if you are new), detects NestJS, installs the SDK, wires the module, and registers the settings your API needs.
Everything after login, already there
Verifying a token is the visible part. The wins are everything you no longer have to build around it.
-
Routes guarded by default
Protect everything globally or mark individual endpoints; public routes are the ones you declare.
Security -
Every sign-in method
Email, passkeys, magic link, and Google, hosted or in your own UI, toggled with no redeploy.
UX -
Authorization built in
Roles ride the verified token, so a controller can require one with a single decorator.
RBAC -
Enterprise SSO ready
When the security questionnaire arrives, connect their identity provider and keep your architecture.
Enterprise -
Built for teams
Multi-tenant user management out of the box: workspaces, invites, and roles included.
B2B -
Session management
Sessions issued, renewed, and revoked centrally. Block a user and they are out on the next request.
Control -
MFA included
Multi-factor authentication ships with the platform, no extra vendor to integrate.
Trust -
API tokens for machines
External services and scripted callers authenticate with API tokens you can revoke at any time.
M2M
Prefer to wire it yourself?
Pick the workflow that matches how you build.
// app.module.ts
import { BridgeModule } from '@nebulr-group/bridge-nestjs';
@Module({
imports: [
BridgeModule.forRoot({ appId: BRIDGE_APP_ID }),
],
})
export class AppModule {}
// in any controller:
findAll(@CurrentUser() user: BridgeUser) { ... }First-class SDKs for every stack
Type-safe, batteries-included SDKs with drop-in components, and the same clean user object everywhere.
…and 24+ frameworks & languages supported. Hover to pause, drag or swipe to explore.
Hand-Rolled NestJS Authentication vs. The Bridge
What a hand-built NestJS auth stack actually costs you, versus one module import.
Building it yourself
- Wire Passport strategies, an auth module, and a JWT guard yourself
- Stand up login, session, refresh, and logout endpoints
- Manage signing keys, rotation, and token revocation
- Add SSO, more sign-in methods, and user management when customers ask
With The Bridge
- One module import, routes guarded by default
- Login hosted for you or dropped into your UI, nothing to stand up
- Tokens verified against published keys, revocation included
- SSO and multi-tenant user management on the same user object
Common questions
How do I protect routes with a NestJS guard?
Do I need Passport strategies?
Does this use JWT authentication?
How do I get the current user in a controller?
How do I check roles in NestJS?
Where does login happen if NestJS only verifies tokens?
How do machines and scripts authenticate?
Which NestJS versions does the SDK support?
add auth to your NestJS API?
Getting started takes minutes. No credit card required.
Sign up and start buildingExplore every identity guide
Every auth question you were saving for later, answered in its own guide. Pick one and go build.
Add login to your React app in minutes: drop-in login, protected routes in one wrapper.
Read guide →Add login to your Angular app in minutes: one provider call, routes locked by default.
Read guide →Middleware locks every route by default, drop-in login for the App Router.
Read guide →Every endpoint locked by default: tokens verified, roles per route, API keys for machines.
Read guide →Hosted login, routes locked by default, one call in your root layout.
Read guide →RBAC for Server Actions and Edge Middleware.
SoonHeader, payload, signature, JWKS, and the mistakes that breach apps.
Read guide → JWT DecoderDecode, validate, and debug tokens in your browser: health report, tamper playground, JWKS checks.
Read guide → Microservices AuthGateway, per-service JWT, or central identity: the real trade-offs.
Read guide → Multi-Tenant SetupOne login, many workspaces, roles per workspace.
Read guide →
