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

# JavaScript SDK Installation

> Install @anyway-sh/node-server-sdk via npm, with ESM/Next.js instrumentModules setup

<CardGroup cols={2}>
  <Card title="@anyway-sh/node-server-sdk on npm" icon="npm" href="https://www.npmjs.com/package/@anyway-sh/node-server-sdk">
    View package on npm
  </Card>

  <Card title="Source on GitHub" icon="github" href="https://github.com/anyway-platform/anyway-tracing/tree/main/packages/node-server-sdk">
    View source code
  </Card>
</CardGroup>

## Requirements

* Node.js 18 or higher
* npm, pnpm, or yarn

## Installation

```bash theme={null}
npm install @anyway-sh/node-server-sdk
```

Or with pnpm:

```bash theme={null}
pnpm add @anyway-sh/node-server-sdk
```

## Verify Installation

```typescript theme={null}
import { initialize } from "@anyway-sh/node-server-sdk";

initialize({
  appName: "test-app",
});

console.log("SDK installed successfully!");
```

## ESM / Next.js

If your project uses ES modules, you must pass provider modules explicitly since OpenTelemetry's require-based instrumentation doesn't work with ESM imports:

```typescript theme={null}
import { initialize } from "@anyway-sh/node-server-sdk";
import OpenAI from "openai";

initialize({
  appName: "my-app",
  instrumentModules: {
    openAI: OpenAI,
  },
});
```

See [Configuration](/sdk/js/configuration) for all available `instrumentModules` options.

## Next Steps

<CardGroup cols={2}>
  <Card title="Configuration" icon="gear" href="/sdk/js/configuration">
    Configure the collector endpoint and authentication
  </Card>

  <Card title="Tracing LLM Calls" icon="route" href="/sdk/js/tracing">
    Start tracing your LLM calls
  </Card>
</CardGroup>
