@oidc-token-inspect/core
v0.2.0
Published
Core types, TraceSource interface and built-in HTTP/Live/Composite implementations for the Token Inspect plugin. Includes JWT decode.
Downloads
393
Maintainers
Readme
@oidc-token-inspect/core
Schema types, TraceSource interface and built-in HttpTraceSource, LiveTraceSource, CompositeTraceSource implementations for the Token Inspect plugin. Also includes decodeJwt and shortPreview.
Use this directly if you are integrating the panel without the drop-in browser bundle, or if you are writing your own adapter.
Install
npm install @oidc-token-inspect/coreBasic use
import {
HttpTraceSource,
LiveTraceSource,
CompositeTraceSource,
decodeJwt,
type TraceJournal,
} from '@oidc-token-inspect/core';
const httpClient = {
get: <T = TraceJournal>(path: string): Promise<T> =>
fetch(path, { credentials: 'include' }).then((r) => r.json() as Promise<T>),
};
const source = new HttpTraceSource(httpClient, '/api/inspect');
const journal = await source.getJournal();
console.log(journal.runs);See the main README and architecture docs for the full picture.
License
MIT.
