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

# Quick Start

> Work with the Re-Factor TypeScript SDK

## Installation

```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
```

## Configuration

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

```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>');
```

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

```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);
```

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


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.