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

# Quick Start

> Work with the Re-Factor TypeScript SDK

## Installation

<CodeGroup>
  ```bash npm theme={null}
  npm install @re-factor/sdk
  ```

  ```bash yarn theme={null}
  yarn add @re-factor/sdk
  ```

  ```bash pnpm theme={null}
  pnpm add @re-factor/sdk
  ```

  ```bash bun theme={null}
  bun add @re-factor/sdk
  ```
</CodeGroup>

## Configuration

To connect the SDK to your Re-Factor instance, you need to set the following environment variables:

<CodeGroup>
  ```bash shell theme={null}
  export REFACTOR_ACCOUNT_ID=<your_account_id>
  export REFACTOR_API_KEY=<your_api_key>
  export REFACTOR_API_URL=<your_api_url>
  ```

  ```bash .env theme={null}
  REFACTOR_ACCOUNT_ID=<your_account_id>
  REFACTOR_API_KEY=<your_api_key>
  REFACTOR_API_URL=<your_api_url>
  ```

  ```ts typescript theme={null}
  import { Context as RefactorContext } from '@re-factor/sdk/context';

  RefactorContext.setAccountID('<your_account_id>');
  RefactorContext.setAPIKey('<your_api_key>');
  RefactorContext.setAPIUrl('<your_api_url>');
  ```
</CodeGroup>

Or, to use the SDK in [development mode](/sdk/ts/development), set the following environment variable:

<CodeGroup>
  ```bash shell theme={null}
  export REFACTOR_DEVELOPMENT_MODE=true
  ```

  ```bash .env theme={null}
  REFACTOR_DEVELOPMENT_MODE=true
  ```

  ```ts typescript theme={null}
  import { Context as RefactorContext } from '@re-factor/sdk/context';

  RefactorContext.setDevelopmentMode(true);
  ```
</CodeGroup>

Note that to use `re-factor` in development mode you will need to run the `re-factor dev` command before using the SDK.
