UNPKG

embassy

Version:

Simple JSON Web Tokens (JWT) with embedded scopes for services

27 lines (26 loc) 842 B
import { Token } from './Token'; import { EmbassyOptions, ManualClaims } from './types'; export declare class Embassy { private tokenOptions; /** * Creates a new Embassy instance. * * @param opts - Options with which to initialize every new {@link Token}. */ constructor(opts?: EmbassyOptions); /** * Creates a new Token, optionally initializing it with a set of claims. * * @param claims - A mapping of JWT claim keys to appropriate values * @returns The newly created Token */ createToken(claims?: ManualClaims): Token; /** * Creates a Token object from a signed JWT string. * * @param token - The JWT to be parsed * @returns A token object, initiated with the data contained in the token * string */ parseToken(token: string): Token; }