export declare const NFL_API_HOST = "https://api.nfl.com"; /** Options for {@link nflTokenGen}. */ export interface NflTokenOptions { /** Override the client key (else `NFL_CLIENT_KEY`, else the web default). */ clientKey?: string; /** Override the client secret (else `NFL_CLIENT_SECRET`, else the default). */ clientSecret?: string; /** Mint a new token even if a cached one is still valid. */ forceRefresh?: boolean; } /** * Best-effort read of a JWT's `exp` claim (unix seconds); `null` if unparseable. * * The token is `header.payload.signature`; the payload segment is base64url * decoded and its `exp` claim returned. No signature verification — only the * expiry is needed to schedule renewal. Exported for unit testing. */ export declare function jwtExp(token: string): number | null; /** Drop the cached `api.nfl.com` token (forces a fresh mint on the next call). */ export declare function nflClearTokenCache(): void; /** * Return a valid `api.nfl.com` bearer token, minting + caching as needed. * * The token is cached in-process and reused until ~2 min before its own JWT * `exp`, then transparently re-minted — so callers never have to think about * expiry or refresh. The first call (or any call after expiry / `forceRefresh`) * mints a fresh token via the anonymous device-token grant at * `/identity/v3/token`. * * Resolution order (all overrides optional): * 1. `NFL_ACCESS_TOKEN` env var — returned verbatim, skipping minting + * caching. Ignored if explicit credentials are passed. * 2. Credentials: explicit `clientKey`/`clientSecret` opts -> `NFL_CLIENT_KEY` * / `NFL_CLIENT_SECRET` env vars -> the bundled public `WEB_DESKTOP` pair. */ export declare function nflTokenGen(opts?: NflTokenOptions): Promise; /** * Build the request-header dict expected by `api.nfl.com`. * * Obtains a bearer token via {@link nflTokenGen} (which caches + auto-renews, or * honors `NFL_ACCESS_TOKEN`) unless `token` is supplied, and combines it with the * browser-style headers the NFL.com web app sends. * * @param token An existing access token to reuse; mints/caches one when omitted. */ export declare function nflHeadersGen(token?: string): Promise>; //# sourceMappingURL=nfl_auth.d.ts.map