open-index/open-npm huggingface dataset:
npm package: @plucky-ai/node
Description: Official Node.js SDK for the Plucky API
Author: Plucky AI
Latest version: 0.2.1

# @plucky-ai/node

Official Node.js SDK for the Plucky API. Use this package to interact with the Plucky API from your server-side applications.

## Installation

```bash
npm install @plucky-ai/node
# or
yarn add @plucky-ai/node
# or
pnpm add @plucky-ai/node
```

## Quick Start

```typescript
import Plucky from '@plucky-ai/node'

const plucky = new Plucky({
  apiKey: 'sk_...', // Get your API key from https://app.plucky.ai
})

// List all chats
const { results: chats } = await plucky.chats.list()
console.log(chats)

// Create a new chat
const chat = await plucky.chats.create({
  title: 'Support Conversation',
})

// Get a specific chat
const chatDetails = await plucky.chats.find({ id: chat.id })
```

## Configuration

```typescript
import Plucky from '@plucky-ai/node'

const plucky = new Plucky({
  // Required: Your API key
  apiKey: 'sk_...',

  // Optional: Custom base URL (defaults to https://api.plucky.ai)
  baseUrl: 'https://api.plucky.ai',

  // Optional: Custom fetch implementation
  fetch: customFetch,
})
```

## API Reference

### Chats

```typescript
// List all chats
const { results } = await plucky.chats.list()

// Create a chat
const chat = await plucky.chats.create({ title: 'My Chat' })

// Get a chat by ID
const chat = await plucky.chats.find({ id: 'chat_123' })
```

### Apps

```typescript
// List all apps
const { results } = await plucky.apps.list()

// Get an app by ID
const app = await plucky.apps.find({ id: 'app_123' })
```

## Advanced Usage

### Using the raw client

For advanced use cases, you can access the underlying typed API client:

```typescript
import Plucky from '@plucky-ai/node'

const plucky = new Plucky({ apiKey: 'sk_...' })

// Access the raw client
const client = plucky.api
```

### Using createApiClient directly

If you prefer more control, use `createApiClient`:

```typescript
import { createApiClient } from '@plucky-ai/node'

const client = createApiClient({
  apiKey: 'sk_...',
  baseUrl: 'https://api.plucky.ai',
})

const chats = await client.chats.list()
```

## TypeScript

This package is written in TypeScript and includes full type definitions. All API responses are fully typed.

```typescript
import Plucky, { type PluckyOptions, type ApiClient } from '@plucky-ai/node'
```

## Requirements

- Node.js 18.0.0 or later

## License

MIT