@speechly/browser-client
Version:
JavaScript client for Speechly Streaming API
21 lines (20 loc) • 778 B
TypeScript
type fetchFn = (input: RequestInfo, init?: RequestInit) => Promise<Response>;
type nowFn = () => number;
export declare const minTokenValidTime: number;
/**
* @internal
*/
export interface Token {
appId: string;
projectId: string;
deviceId: string;
configId: string;
scopes: string[];
issuer: string;
audience: string;
expiresAtMs: number;
}
export declare function fetchToken(baseUrl: string, projectId: string | undefined, appId: string | undefined, deviceId: string, fetcher?: fetchFn, nowFn?: nowFn): Promise<string>;
export declare function validateToken(token: string, projectId: string | undefined, appId: string | undefined, deviceId: string, now?: nowFn): boolean;
export declare function decodeToken(token: string): Token;
export {};