Skip to content
Dashboard
Theme
Theme

Your sandbox keys

Where the code samples get their keys, and how to show your own sandbox keys here while signed in to the dashboard.

View Markdown

Every code sample in these docs reads its keys from the server process environment, for example process.env.OHAUTHCAT_API_KEY or os.environ["OHAUTHCAT_API_KEY"]. No page contains a real key, and no key is ever built into a page.

  1. Sign in to the dashboard and open your sandbox environment.
  2. Open API keys. The secret key (sk_test_…) stays on your server. The publishable key is the SSO client ID.
  3. Set them in the environment of the process that runs your server, as OHAUTHCAT_API_KEY and OHAUTHCAT_CLIENT_ID. Never put a secret key in browser code or a committed file.

The CLI can also supply credentials: ohauthcat login stores them in your OS keychain, and OHAUTHCAT_API_KEY overrides them for CI. See Install the CLI and sign in.

If you are signed in to the dashboard in this browser, this page can show the keys of one of your sandbox environments. Enter its environment ID; a dashboard link can also pass it as ?environment=env_… in this page’s address.

It starts with env_, such as env_01J9Z3K5V7W8X9Y0Z1A2B3C4D5.

What this shows, and what it never does:

  • Sandbox environments only. A production environment ID is refused with parameter_invalid, and nothing is shown.
  • The newest live keys. The publishable key is shown in full; it is the SSO client ID and safe in a browser. For the secret key, only its prefix followed by •••• is shown, never the secret itself. Copy the full secret once from the dashboard’s API keys page.
  • Viewers see the publishable key only. The secret key prefix needs the developer role or higher.
  • In your browser, at the time you ask. The page asks the API for them with your dashboard session. Keys are never built into a page, never stored, and the code samples on other pages keep their environment variable names. The page remembers only the environment ID, in this browser.
  • Your account only. An environment of another account reads as not found.
  • Not during an outage. The route is never served by the standby API, so during a failover this page cannot show keys; use the values you already set in your server’s environment.

The same keys are on the dashboard’s API keys page, where you also revoke them; ohauthcat keys revoke prints its link.