Injectable adapter that persists JWT signing keys across process restarts.
Implementations may target the filesystem, a KV store, Redis, etc. The default behaviour (no adapter) is purely in-memory — keys are lost on restart.
const adapter = new JsonFileKeyPersistenceAdapter({ filePath: '/data/keys.json' });const provider = new IdentityProvider({ keyPersistenceAdapter: adapter }); Copy
const adapter = new JsonFileKeyPersistenceAdapter({ filePath: '/data/keys.json' });const provider = new IdentityProvider({ keyPersistenceAdapter: adapter });
Load the persisted key set. Returns null if no persisted state exists yet (first startup).
null
Persist the current key set. Implementations should write atomically to avoid corruption.
Injectable adapter that persists JWT signing keys across process restarts.
Implementations may target the filesystem, a KV store, Redis, etc. The default behaviour (no adapter) is purely in-memory — keys are lost on restart.
Example