UNPKG

biketag

Version:

The Javascript client API for BikeTag Games

32 lines (31 loc) 1.53 kB
import { PartialBikeTagConfiguration } from './types'; import { BikeTagClient } from '../client'; export declare function getAuthorizationHeader(client: BikeTagClient): Promise<string>; export declare const retrieveBiketagJwt: (client: BikeTagClient, clientAssertionOverride?: string, clientPlayerId?: string) => Promise<string>; /** * getClaims * * Purpose: * ----------- * Given an `authorization` token, this function passively introspects the token * and determines if it matches any configured adapter credentials * (biketag, imgur, aws, sanity) within this BikeTagClient instance. * * Behavior: * ----------- * - If the provided `authorization` matches the configured biketag clientToken, * returns the biketag adapter credentials. * - If it matches an imgur, aws, or sanity token, returns those credentials. * - If no match is found or if `authorization` is not provided, returns an empty object (`{}`). * * Notes: * ----------- * - This function does NOT proactively obtain new credentials * - This utility serves primarily as a way to inspect "What does this token map to?" * * @param client - The BikeTagClient instance holding current adapter configurations. * @param authorization - The authorization token to introspect. * @returns PartialBikeTagConfiguration containing the matched adapter credentials * or `{}` if no match is found. */ export declare function getClaims(client: BikeTagClient, authorization?: string): Promise<PartialBikeTagConfiguration | Record<string, never>>;