Skip to content

Programmatic access to stage

Our stage environment does require authentication to ensure only qualified and active employees of Statista have access to that environment.

To automate tasks (e.g. talk to stage APIs, run tests, ...) it might be required to get programmatic access. The following steps are required to enable programmatic access:

1. Request an oauth token

If running inside AWS and a JS Environment you are free to use this convenience package to get a token:

import { authToken } from '@pit-shared/dev-env-authenticator-client/token'
const token = await authToken()

make sure to add your account first to the allow listdocumented here This allows your account to read the token secret from the secrets manager.

If not, simply request the Token from an Architect, but be ready to have it not working anymore when rotated!

2. Use the token to do requests on stage

Send the token with all requests to stage as an X-Stage-Authorization or Authorization header.

curl -H "X-Stage-Authorization: <your-token>" https://stage.statista.com