Skip to content

Documentation

Live and test environments

How the two environments are kept apart, and why it is enforced by the shape of an API key rather than by a filter.

Every app has two environments, live and test. They are separate worlds rather than a filter on one list, and the separation is enforced by the shape of an API key.

A key belongs to one environment

Not to an account, and not to an organisation — to one app and one environment. There is no key that works in both, and no way to move a key between them.

The practical consequence is that a test key cannot read or change live data even if you want it to. The server reads the app and the environment off the key row it just authenticated, so there is no parameter in any request that could name the other one.

The environment is in the key, and in the answerbash
curl https://app.quberoute.com/api/v1/app \
  -H "Authorization: Bearer qr_sk_test_YOUR_KEY"

{ "app": { ... }, "environment": "test" }

The live or test in the middle of the key is deliberate. A key pasted into the wrong configuration is obvious on sight, and a live key that reaches a public repository is recognisable to automated secret scanners.

The same alias can exist in both

Link aliases are unique within an app and environment. So spring-sale can exist in test and in live at the same time without colliding, which means you can rehearse exactly the link you intend to publish.

Test is never billed

Links and keys created in test do not count towards your allowance. Test is for testing; charging for it would only teach people to test in live.

In the dashboard

The switch is in the bar at the top of every page, and while you are in test there is an unmissable band across the whole screen saying so.

That band is not decoration. Somebody who believes they are looking at live data when they are not will draw the wrong conclusions; somebody who believes they are in test when they are in live could publish a throwaway link to real customers. When the setting is unclear it resolves to live, because that is the safer direction to be wrong in.

Which environment am I in?

Ask the API. It answers from the key, so it cannot disagree with reality:

A one-line check before a deploybash
curl -s https://app.quberoute.com/api/v1/app \
  -H "Authorization: Bearer $DEEPLINK_API_KEY" \
  | grep -o '"environment":"[a-z]*"'

Ask the documentation

It answers from these pages only, and links what it used. If the answer is not here it says so rather than guessing — then email [email protected].

← All documentation