Skip to content

core — Code View

← Back to Container | ← Back to System


Component Information

Field Value
Component core
Container @chrislyons-dev/flarelette-jwt
Type module
Description CLI utility for generating JWT secrets.

This script provides options to generate secrets in various formats, including JSON and dotenv.
It is designed to be executed as a standalone Node.js script. | Configuration utilities for JWT operations.

This module provides functions to read environment variables and derive JWT-related configurations.
It includes support for both symmetric (HS512) and asymmetric (EdDSA) algorithms. | JWT signing utilities.

This module provides functions to sign JWT tokens using either HS512 or EdDSA algorithms.
It supports custom claims and configuration overrides.
---

Code Structure

Class Diagram

Class Diagram

Code Elements

11 code element(s) #### Functions ##### `envRead()` | Field | Value | | --- | --- | | **Type** | `function` | | **Visibility** | `private` | | **Returns** | `string` || **Location** | `C:/Users/chris/git/flarelette-jwt-kit/packages/flarelette-jwt-ts/src/config.ts:13` | **Parameters:** - `name`: string --- ##### `envMode()` | Field | Value | | --- | --- | | **Type** | `function` | | **Visibility** | `public` | | **Returns** | `import("C:/Users/chris/git/flarelette-jwt-kit/packages/flarelette-jwt-ts/src/types").AlgType` || **Location** | `C:/Users/chris/git/flarelette-jwt-kit/packages/flarelette-jwt-ts/src/config.ts:23` | **Parameters:** - `role`: "producer" | "consumer" --- ##### `getCommon()` Get common JWT configuration from environment Returns partial JwtProfile-compatible configuration | Field | Value | | --- | --- | | **Type** | `function` | | **Visibility** | `public` | | **Returns** | `{ iss: string; aud: string; leeway: number; ttlSeconds: number; }` || **Location** | `C:/Users/chris/git/flarelette-jwt-kit/packages/flarelette-jwt-ts/src/config.ts:66` | --- ##### `getProfile()` Get JWT profile from environment Returns complete JwtProfile with detected algorithm | Field | Value | | --- | --- | | **Type** | `function` | | **Visibility** | `public` | | **Returns** | `Partial & { ttlSeconds: number; }` || **Location** | `C:/Users/chris/git/flarelette-jwt-kit/packages/flarelette-jwt-ts/src/config.ts:79` | **Parameters:** - `role`: "producer" | "consumer" --- ##### `getHSSecret()` | Field | Value | | --- | --- | | **Type** | `function` | | **Visibility** | `public` | | **Returns** | `Uint8Array` || **Location** | `C:/Users/chris/git/flarelette-jwt-kit/packages/flarelette-jwt-ts/src/config.ts:94` | --- ##### `getPrivateJwkString()` | Field | Value | | --- | --- | | **Type** | `function` | | **Visibility** | `public` | | **Returns** | `string` || **Location** | `C:/Users/chris/git/flarelette-jwt-kit/packages/flarelette-jwt-ts/src/config.ts:127` | --- ##### `getPublicJwkString()` | Field | Value | | --- | --- | | **Type** | `function` | | **Visibility** | `public` | | **Returns** | `string` || **Location** | `C:/Users/chris/git/flarelette-jwt-kit/packages/flarelette-jwt-ts/src/config.ts:133` | --- ##### `getJwksServiceName()` | Field | Value | | --- | --- | | **Type** | `function` | | **Visibility** | `public` | | **Returns** | `string` || **Location** | `C:/Users/chris/git/flarelette-jwt-kit/packages/flarelette-jwt-ts/src/config.ts:139` | --- ##### `getJwksUrl()` | Field | Value | | --- | --- | | **Type** | `function` | | **Visibility** | `public` | | **Returns** | `string` || **Location** | `C:/Users/chris/git/flarelette-jwt-kit/packages/flarelette-jwt-ts/src/config.ts:145` | --- ##### `getJwksCacheTtl()` | Field | Value | | --- | --- | | **Type** | `function` | | **Visibility** | `public` | | **Returns** | `number` || **Location** | `C:/Users/chris/git/flarelette-jwt-kit/packages/flarelette-jwt-ts/src/config.ts:151` | --- ##### `sign()` Sign a JWT token with HS512 or EdDSA algorithm | Field | Value | | --- | --- | | **Type** | `function` | | **Visibility** | `public` | | **Async** | Yes || **Returns** | `Promise` - Signed JWT token string || **Location** | `C:/Users/chris/git/flarelette-jwt-kit/packages/flarelette-jwt-ts/src/sign.ts:22` | **Parameters:** - `payload`: import("C:/Users/chris/git/flarelette-jwt-kit/packages/flarelette-jwt-ts/src/types").JwtPayload — - Claims to include in the token (can include custom claims beyond standard JWT fields)- `opts`: Partial<{ iss: string; aud: string | string[]; ttlSeconds: number; }> — - Optional overrides for iss, aud, ttlSeconds ---