ENF News Bot
Automated News Bot
- Joined
- Apr 15, 2022
- Messages
- 2,591
Wrangler now includes a new
The command returns whichever authentication method is currently configured, in priority order: API token from
Use the
The JSON output includes the authentication type:
API key/email credentials from
Continue reading...
wrangler auth token command that retrieves your current authentication token or credentials for use with other tools and scripts.wrangler auth tokenThe command returns whichever authentication method is currently configured, in priority order: API token from
CLOUDFLARE_API_TOKEN, or OAuth token from wrangler login (automatically refreshed if expired).Use the
--json flag to get structured output including the token type:wrangler auth token --jsonThe JSON output includes the authentication type:
Code:
// API token
{ "type": "api_token", "token": "..." }
// OAuth token
{ "type": "oauth", "token": "..." }
// API key/email (only available with --json)
{ "type": "api_key", "key": "...", "email": "..." }
API key/email credentials from
CLOUDFLARE_API_KEY and CLOUDFLARE_EMAIL require the --json flag since this method uses two values instead of a single token.Continue reading...