Installation
Install the package via npm:
npm install @ng-catbee/jwt
Zero Configuration
This library works out of the box with zero configuration. Simply inject the CatbeeJwtService and start using it.
Standalone Apps (Angular 17+)
No additional setup required. Just inject the service directly:
import { Component, inject } from '@angular/core';
import { CatbeeJwtService } from '@ng-catbee/jwt';
@Component({
selector: 'app-root',
standalone: true,
template: `...`
})
export class AppComponent {
private jwtService = inject(CatbeeJwtService);
decodeToken(token: string) {
return this.jwtService.decodePayload(token);
}
}
Module-based Apps
The service is provided in root by default, so no module imports needed:
import { Component, inject } from '@angular/core';
import { CatbeeJwtService } from '@ng-catbee/jwt';
@Component({
selector: 'app-root',
template: `...`
})
export class AppComponent {
private jwtService = inject(CatbeeJwtService);
}
Next Steps
- Usage Guide - Learn how to decode and validate JWTs
- API Reference - Complete API documentation