> ## Documentation Index
> Fetch the complete documentation index at: https://docs.timeback.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Environment

> Select the SDK environment, platform, and credentials explicitly

## SDK setup

Configure credentials on the server. Environment variable names in an application example are inputs you pass to the SDK; your framework must load them. Follow the full [server adapter setup](https://docs.timeback.com/beta/build-on-timeback/sdk/server/nextjs.md), including identity and session callbacks.

```bash .env.local theme={null}
TIMEBACK_API_CLIENT_ID=your-staging-client-id
TIMEBACK_API_CLIENT_SECRET=your-staging-client-secret
```

For SSO, also supply the Cognito credentials required by your identity configuration. Names such as `AWS_COGNITO_CLIENT_ID` and `AWS_COGNITO_CLIENT_SECRET` in these guides are application conventions: pass their values into `identity.clientId` and `identity.clientSecret` explicitly. Custom identity uses your existing authenticated session instead.

Use `env: 'staging'` or `env: 'production'` explicitly. The SDK also supports `local`, which uses staging API configuration and overrides; it is not an offline emulator.

## Direct TypeScript clients

The composed client can resolve the canonical `TIMEBACK_API_CLIENT_ID` and `TIMEBACK_API_CLIENT_SECRET` environment variables, but explicit constructor options make the selected environment and platform clear:

```typescript theme={null}
import { TimebackClient } from '@timeback/core'

const api = new TimebackClient({
  env: 'staging',
  platform: 'BEYOND_AI',
  clientId: process.env.TIMEBACK_API_CLIENT_ID!,
  clientSecret: process.env.TIMEBACK_API_CLIENT_SECRET!,
})
```

The reviewed clients default to `BEYOND_AI`; `LEARNWITH_AI` is a separate endpoint selection. Platform support is service-specific. A constructor accepting a platform does not prove every method matches that platform's currently deployed routes. See [API reference](https://docs.timeback.com/beta/api-reference/overview.md) and the [Caliper client](https://docs.timeback.com/beta/build-on-timeback/clients/caliper.md) before changing receivers.

### Credential and URL fallback names

For individual TypeScript OneRoster, EduBridge, QTI, PowerPath, and Caliper clients, canonical names take precedence over shorthand and service-specific legacy names:

| Setting | Canonical | Shorthand | Service-specific legacy |
| - | - | - | - |
| Client ID | `TIMEBACK_API_CLIENT_ID` | `TIMEBACK_CLIENT_ID` | e.g. `ONEROSTER_CLIENT_ID` |
| Client secret | `TIMEBACK_API_CLIENT_SECRET` | `TIMEBACK_CLIENT_SECRET` | e.g. `ONEROSTER_CLIENT_SECRET` |
| API base URL | `TIMEBACK_API_BASE_URL` | `TIMEBACK_BASE_URL` | e.g. `ONEROSTER_BASE_URL` |
| OAuth token URL | `TIMEBACK_API_AUTH_URL` | `TIMEBACK_AUTH_URL` | e.g. `ONEROSTER_TOKEN_URL` |

Replace `ONEROSTER` with `EDUBRIDGE`, `QTI`, `POWERPATH`, or `CALIPER` for that client's legacy names. The composed client also reads `TIMEBACK_ENV`. Use each client's constructor documentation for explicit URL overrides; the different services do not share one universal base URL.

The Caliper client uses OAuth client credentials. `CALIPER_API_KEY` and `CALIPER_SENSOR_URL` are not credential/config fallbacks in the reviewed package. An event sensor identifies the producer and is not the HTTP ingestion URL.

> [!NOTE]
>
> The reviewed BeyondAI constants use `api.staging.alpha-1edtech.ai` / `api.alpha-1edtech.ai` for the main API and separate Caliper hosts. Both staging and production QTI constants point to `https://qti.alpha-1edtech.ai/api`. Selecting staging therefore does not by itself establish isolation for every service. Confirm the receiver and credentials before creating or changing data.

## Python

Pass credentials and environment explicitly when creating the Python client or server. Do not assume every TypeScript fallback variable or platform option is identical in Python. See [Core client](https://docs.timeback.com/beta/build-on-timeback/clients/core.md) and [FastAPI setup](https://docs.timeback.com/beta/build-on-timeback/sdk/server/fastapi.md).

## Secret handling

Keep API and SSO client secrets on the server. Exclude local secret files from version control and use your deployment environment's secret storage. Browser providers communicate with your mounted SDK routes; they do not need these client secrets.

The CLI maintains its own credential store. Configuring application environment variables is separate from selecting credentials for [`timeback resources`](https://docs.timeback.com/beta/build-on-timeback/cli/resources).
