# Environments

> Select the STX exchange the client connects to.

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

The exchanges, their hosts and which one to start with are listed on [Environments](/environments/). In the SDK, pick one with `environment`, or with `region` and `env` (as options, as `STX_REGION` and `STX_ENV`, or in a credentials profile):

| Exchange | `environment` | `region` | `env` |
|---|---|---|---|
| STX US demo | `Environments.USDemo` | `"us"` | `"demo"` |
| STX Ontario demo | `Environments.OntarioDemo` | `"ontario"` | `"demo"` |
| STX Ontario | `Environments.OntarioProduction` | `"ontario"` | `"production"` |

```ts
import { Environments, STX } from "@stxapp/stx-typescript";

const client = new STX({ environment: Environments.USDemo, keyId, privateKey });
// same exchange:
const same = new STX({ region: "us", env: "demo", keyId, privateKey });
```

An API key works on one exchange only, so keep one credentials profile per exchange and switch with `profile`.

To reach any other host, such as a local server, pass `host: "http://localhost:4000"` (or set `STX_HOST`). The URL's scheme is kept for both HTTP and the socket.
