# Environments

> Demo and production base URLs for each region.

Source: https://docs.stxapp.io/environments/

export const env = (region, id) => cfg.regions.find((r) => r.id === region).environments.find((e) => e.id === id)
export const host = (url) => url.replace('https://', '')

Each exchange has its own hosts. The base URL is where your API requests and
WebSocket connections go.

{cfg.regions.map((region) => (
  <>
    <h2 id={region.id}>{region.label}</h2>
    <table>
      <thead>
        <tr><th>Environment</th><th>Base URL</th><th>Status</th></tr>
      </thead>
      <tbody>
        {region.environments.map((env) => (
          <tr>
            <td>
              <strong>{env.label}</strong>
              <br />
              <small>{env.note}</small>
            </td>
            <td>{env.url
              ? <a href={env.url}><code>{env.url.replace('https://', '')}</code></a>
              : <span>-</span>}</td>
            <td>{env.status === 'live' ? 'Available' : env.status === 'internal' ? 'Internal only' : 'Planned'}</td>
          </tr>
        ))}
      </tbody>
    </table>
  </>
))}

## Which one should I use?

Pick the exchange you are integrating with. Accounts and keys do not carry
across, so this decision comes before everything else. See
[United States and Canada](/concepts/us-and-canada/) if you are not sure which.

**United States**: use <code>{host(env('us', 'integration').url)}</code>, and register there for an account and
key. Shared by every developer integrating with STX, so the order books carry
real activity. No real money. US production is launching soon: start integrating on
demo now.

**Ontario**: use <code>{host(env('ca', 'integration').url)}</code>, and register there for an account and key.
When you are ready for production, register at <code>{host(env('ca', 'production').appUrl)}</code>, create a new key
there, and send your requests to <code>{host(env('ca', 'production').url)}</code>.

:::caution
Production is live money. Point at it only once your integration is exercised
end to end on demo.

A key belongs to one environment. **Demo keys do not work in production**: create
a separate production key, or every request is rejected with a 401.
:::
