@oliego/qwicklink
v0.1.1
Published
Qwick.Link Platform SDK
Downloads
1,259
Maintainers
Readme
@oliego/qwicklink
The official TypeScript/JavaScript SDK for the QwickLink Platform. Integrate knowledge base management, AI-powered search, and chat capabilities into your application with minimal effort.
🚀 Features
- Type-Safe: Written in TypeScript with full IntelliSense support.
- Resilient: Built-in exponential backoff retry logic for
429and5xxerrors. - Lightweight: Zero external dependencies (uses native Fetch API).
- Flexible: Supports pagination, filtering, and custom configurations.
📦 Installation
npm install @oliego/qwicklink
# or
yarn add @oliego/qwicklink
# or r
pnpm add @oliego/qwicklink🛠️ Quick Start
import { QwickLink } from '@oliego/qwicklink';
const sdk = new QwickLink('your_api_key_here');
// Fetch a single KB entry
async function getArticle() {
const response = await sdk.getKbEntry('kb_01');
if (response.error) {
console.error("Error:", response.error);
return;
}
console.log(response.data.title);
}
getArticle();
📖 API Reference
Knowledge Base (/kb)
getKb(filters?: KbFilters)
Fetch a paginated list of entries.
const result = await sdk.getKb({
page: 1,
limit: 10,
category: 'api-docs'
});
getKbEntry(id: string)
Fetch a single entry by its unique ID.
Search & Chat
getSearch({ query: string })
Search through the knowledge base using natural language.
postChat({ message: string })
Interact with the platform's chat AI.
⚙️ Advanced Configuration
You can customize the retry behavior and base URL during initialization:
const sdk = new QwickLink('your_api_key', 'https://custom.api.endpoint.com', {
maxRetries: 5, // Number of retry attempts
initialDelayMs: 500 // Initial delay before backoff
});
🧪 Testing
We use Jest for automated testing. To run the suite:
npm test
📄 License
MIT © Oliego
