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

# Node.js SDK

> Install and use the official Linkryse Node.js SDK.

The Linkryse Node.js SDK is the easiest way to interact with the Linkryse API from your Node.js applications.

## Installation

Install the package via npm or yarn:

```bash theme={null}
npm install @linkryse/sdk
# or
yarn add @linkryse/sdk
```

## Initialization

Initialize the client with your API key:

```javascript theme={null}
import { Linkryse } from '@linkryse/sdk';

const linkryse = new Linkryse({
  apiKey: 'sk_live_...'
});
```

## Usage

Once initialized, you can use the client to interact with all API resources.

### Create a Link

```javascript theme={null}
const link = await linkryse.links.create({
  url: 'https://google.com',
  domain: 'dub.sh',
  key: 'my-link'
});

console.log(link.shortLink); // https://dub.sh/my-link
```

### Get Analytics

```javascript theme={null}
const stats = await linkryse.analytics.clicks({
  linkId: link.id,
  interval: '7d'
});

console.log(stats);
```
