Function: nflTokenGen()
nflTokenGen(
opts?):Promise<string>
Defined in: core/nfl_auth.ts:130
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):
NFL_ACCESS_TOKENenv var — returned verbatim, skipping minting + caching. Ignored if explicit credentials are passed.- Credentials: explicit
clientKey/clientSecretopts ->NFL_CLIENT_KEY/NFL_CLIENT_SECRETenv vars -> the bundled publicWEB_DESKTOPpair.
Parameters
opts?
NflTokenOptions = {}
Returns
Promise<string>