A TypeScript client library for the Help Scout Docs API, providing a simple and type-safe way to interact with Help Scout's knowledge base API.
npm install @codingrequired/helpscout-api
import { createDocsApiClient } from '@codingrequired/helpscout-api';
// Initialize the client with your API key
const client = createDocsApiClient('your-api-key');
// Example: List all collections
const collections = await client.collections.listCollections({
page: 1,
pageSize: 20
});
// Example: Search articles
const searchResults = await client.articles.searchArticles({
query: 'installation guide',
collectionId: 'collection-id',
visibility: 'public'
});
// Example: Get a specific article
const article = await client.articles.getArticle({
articleIdOrNumber: '123456'
});
listCollections
- List all collectionsgetCollection
- Get a specific collection
listArticles
- List articles in a collectionsearchArticles
- Search for articlesgetArticle
- Get a specific articlecreateArticle
- Create a new articleupdateArticle
- Update an existing articledeleteArticle
- Delete an articlelistRelatedArticles
- List related articleslistRevisions
- List article revisionsgetRevision
- Get a specific revisionupdateViewCount
- Update article view countsaveArticleDraft
- Save an article draftdeleteArticleDraft
- Delete an article draft
createArticleAsset
- Upload an asset for an articlecreateSettingsAsset
- Upload an asset for settings
The other endpoints will be added later.
- Node.js 20 or higher
- Help Scout API key with Docs API access
# Install dependencies
npm install
# Build the library
npm run build
# Watch mode for development
npm run dev
MIT
Contributions are welcome! Please feel free to submit a Pull Request.