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

# Langtrace Typescript SDK

## Github

> Github repository for Langtrace Typescript SDK's -> [Scale3-Labs/langtrace-typescript-sdk](https://github.com/Scale3-Labs/langtrace-typescript-sdk).

<Warning>
  The name of Typescript SDK has word `langtrase` with a `s` and NOT
  `langtrace`.
</Warning>

## To use the managed version of Langtrace, follow these steps:

1. Sign up by going to this link [Langtrace](https://langtrace.ai).
2. Create a new Project and Generate an API key.

## Installation

1. In your application, install the Langtrace Typescript SDK using npm:

```bash Shell theme={null}
# Install the SDK
npm i @langtrase/typescript-sdk
```

## Initialization

1. Initialize the Langtrace SDK with the API key you generated in the step 2:

```bash typescript theme={null}
# Import it into your project. Must precede any llm module imports
import * as Langtrace from "@langtrase/typescript-sdk";
Langtrace.init({ api_key: '<LANGTRACE_API_KEY>'})
```

## For self-hosted Langtrace add *`api_host`* and point the URL to your own DNS or IP sddress.Langtrace

Example below:

<CodeGroup>
  ```bash Typescript theme={null}
  import * as Langtrace from "@langtrase/typescript-sdk";
  Langtrace.init({
  	api_key: "<YOUR API KEY>",
  	batch: false,
  	api_host: "http://localhost:3000/api/trace",
  });
  ```
</CodeGroup>

<Note>
  Here we are using `http://localhost:3000/api/trace` as the API host. You can replace it with your own DNS or IP address.
</Note>

For more options on how to use SDK, please refer to [features section](/features).
