CLI OAuth example that starts the iRacing browser authorization flow, waits for
the callback on localhost, and writes returned credentials to
examples/oauth-example-cli/credentials.json.
- Create an
.envfile in this directory with:
IRACING_AUTH_CLIENT=<your-client-id>
IRACING_AUTH_SECRET=<your-client-secret-if-required>
OAUTH_CALLBACK_PORT=4040- Run:
pnpm --filter iracing-oauth-example-cli startOptional flags:
pnpm --filter iracing-oauth-example-cli start -- --callback-port 4040 --credentials-path ./credentials.json --timeout-seconds 300- Press Enter in the CLI prompt to open your browser.
- Complete sign-in in the browser and return to the CLI.
- Find credentials in
credentials.json.