JavaScript/TypeScript SDK
Installation
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
Upload File (Node.js)
Upload File (Browser)
Batch Upload
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
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
Option | Type | Default | Description |
---|---|---|---|
apiKey | string | required | Your Plugged.in API key |
baseUrl | string | https://plugged.in | API base URL |
timeout | number | 60000 | Request timeout in milliseconds |
maxRetries | number | 5 | Maximum retry attempts |
debug | boolean | false | Enable debug logging |
Document Methods
Method | Description |
---|---|
list(filters) | List documents with optional filters |
get(id, options) | Get a specific document |
search(query, filters, limit, offset) | Search documents |
create(title, content, metadata) | Create a new document |
update(id, request) | Update an existing document |
delete(id) | Delete a document |
RAG Methods
Method | Description |
---|---|
query(question) | Simple RAG query |
queryWithSources(question, projectId) | Query with source documents |
findRelevantDocuments(query, projectId, limit) | Find relevant documents |
Upload Methods
Method | Description |
---|---|
uploadFile(file, metadata, onProgress) | Upload a single file |
uploadBatch(files, onProgress) | Upload multiple files |
trackUpload(uploadId, onUpdate) | Track upload processing |
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