Skip to main content
These scripts match the samples in your onboarding pack. Each one runs the full flow end to end:
  1. Sign a JWT client assertion with your ES256 private key.
  2. Exchange it for a short-lived access token.
  3. Call a metadata endpoint with the access token.
Both expect your private key (private_key.pem) next to the script. Replace <OAuthClientId> and <KID> with the values from your onboarding pack. See Request an access token for what each step does.
Requires Node.js 18 or later for the global fetch.
sample_request.ts

Metadata endpoints

Set METADATA_ENDPOINT to any of these. All are GET requests.
Never share your private key with anyone, including Credit Benchmark. Generate a new client assertion for every token request, and if a private key is ever compromised, follow key rotation.