@plucky-ai/node
v0.2.0
Published
Official Node.js SDK for the Plucky API
Maintainers
Readme
@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
npm install @plucky-ai/node
# or
yarn add @plucky-ai/node
# or
pnpm add @plucky-ai/nodeQuick Start
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
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
// 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
// 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:
import Plucky from '@plucky-ai/node'
const plucky = new Plucky({ apiKey: 'sk_...' })
// Access the raw client
const client = plucky.apiUsing createApiClient directly
If you prefer more control, use createApiClient:
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.
import Plucky, { type PluckyOptions, type ApiClient } from '@plucky-ai/node'Requirements
- Node.js 18.0.0 or later
License
MIT
