JavaScript/TypeScript SDK
NPM Package
View on NPM Registry
GitHub Repository
Source code and examples
Installation
- npm
- yarn
- pnpm
Quick Start
Authentication
Get your API key from your Plugged.in Profile and configure the client:Core Features
Document Management
List Documents
Get Document
Search Documents
Create AI-Generated Document
Update Document
RAG Operations
Simple Query
Query with Sources
Find Relevant Documents
File Uploads
Important: Direct file uploads are no longer exposed via the public API. Theclient.uploadshelpers now throw descriptive errors so existing code fails fast. Use the Plugged.in web interface or the forthcoming ingestion workflow for binary files. AI-generated content can still be created withclient.documents.createorclient.uploads.uploadDocument.
Error Handling
The SDK provides typed error classes for better error handling:TypeScript Support
The SDK is written in TypeScript and provides comprehensive type definitions:Advanced Configuration
Environment Variables
Custom HTTP Client
PAP Agents
The SDK provides full support for managing PAP (Plugged.in Agent Protocol) agents:Creating Agents
Listing and Managing Agents
Heartbeats and Metrics
Agent States
Agents follow the PAP lifecycle state machine:Rate Limiting
The SDK automatically handles rate limiting with exponential backoff:- API Endpoints: 60 requests per minute
- Document Search: 10 requests per hour for AI document creation
- RAG Queries: Subject to plan limits
Browser Support
The SDK works in both Node.js and browser environments:Examples
Complete working examples are available in the GitHub repository:API Reference
Client Options
Document Methods
RAG Methods
Upload Methods
All binary upload helpers now throw descriptive errors because the public API no longer exposes direct upload endpoints. Use the web interface or upcoming ingestion pipeline for file uploads.Clipboard Methods
Agent Methods
See PAP Agents API Reference for complete endpoint documentation.
Clipboard (Memory) Service
The Clipboard service provides persistent key-value storage for MCP tools and AI agents.Named Access
Indexed (Stack) Access
List All Entries
TypeScript Types
Support
- NPM Package: https://www.npmjs.com/package/pluggedinkit-js
- GitHub Issues: Report bugs and request features
- Documentation: https://docs.plugged.in
- Discord: Join our community

