### Install @kookee/sdk Source: https://github.com/kookee-dot-dev/kookee-ts-sdk/blob/main/README.md Instructions for installing the @kookee/sdk package using npm, pnpm, or yarn. ```bash npm install @kookee/sdk # or pnpm add @kookee/sdk # or yarn add @kookee/sdk ``` -------------------------------- ### Help Center - Get Article Source: https://context7.com/kookee-dot-dev/kookee-ts-sdk/llms.txt Fetch a single help article by its slug or ID. Includes usefulness vote counts. ```APIDOC ## Help Center - Get Article ### Description Fetch a single help article by slug or ID, including usefulness vote counts. ### Method GET ### Endpoint `/help/articles/slug/{slug}` or `/help/articles/id/{id}` ### Parameters #### Path Parameters - **slug** (string) - Required - The slug of the article to retrieve. - **id** (string) - Required - The ID of the article to retrieve. ### Response #### Success Response (200) - **article** (object) - An object containing the article details: `id`, `slug`, `title`, `contentHtml`, `excerptHtml`, `category` (object with `name` and `slug`), `author` (object with `name`), `usefulYesCount`, `usefulNoCount`, `views`, and `locale`. ### Request Example ```typescript // Get article by slug const article = await kookee.help.getBySlug('getting-started'); // Get article by ID const articleById = await kookee.help.getById('article-uuid'); // Get translations const translations = await kookee.help.getTranslationsBySlug('getting-started'); ``` ``` -------------------------------- ### Manage Blog Posts with Kookee SDK Source: https://github.com/kookee-dot-dev/kookee-ts-sdk/blob/main/README.md Provides examples for listing blog posts with pagination, filtering by tags, searching, retrieving by slug or ID, getting tags, and reacting to posts. ```typescript // List posts with pagination const posts = await kookee.blog.list({ page: 1, limit: 10 }); // Filter by tag slugs const taggedPosts = await kookee.blog.list({ tags: ['news'] }); // Search posts const searchResults = await kookee.blog.list({ search: 'tutorial' }); // Get single post by slug const post = await kookee.blog.getBySlug('my-post'); // Get single post by ID const postById = await kookee.blog.getById('post-uuid'); // Get all tags with post counts const tags = await kookee.blog.getTags(); // React to a post await kookee.blog.react('post-id', { reactionType: 'heart', action: 'add' }); // Get translations const translationsBySlug = await kookee.blog.getTranslationsBySlug('my-post'); const translationsById = await kookee.blog.getTranslationsById('post-uuid'); ``` -------------------------------- ### Blog Module: Retrieve Tags and Translations Source: https://context7.com/kookee-dot-dev/kookee-ts-sdk/llms.txt Provides examples for fetching all available blog tags along with their associated post counts. It also shows how to retrieve all localized versions of a specific blog post, identified by either its slug or ID. ```typescript // Get all tags with post counts const tags = await kookee.blog.getTags(); // Returns: [ // { name: 'News', slug: 'news', count: 15 }, // { name: 'Tutorials', slug: 'tutorials', count: 8 } // ] // Get all translations of a post by slug const translationsBySlug = await kookee.blog.getTranslationsBySlug('hello-world'); // Returns: { en: BlogPost, de: BlogPost, fr: BlogPost } // Get all translations by post ID const translationsById = await kookee.blog.getTranslationsById('post-uuid'); ``` -------------------------------- ### Blog Module: List, Filter, and Search Posts Source: https://context7.com/kookee-dot-dev/kookee-ts-sdk/llms.txt Shows how to retrieve a paginated list of blog posts. It includes examples for filtering posts by tags, searching by keywords, and specifying locale for localized content. ```typescript // List posts with pagination const posts = await kookee.blog.list({ page: 1, limit: 10 }); // Returns: { // data: BlogPostListItem[], // total: 42, // limit: 10, // offset: 0, // page: 1, // totalPages: 5 // } // Filter by tag slugs const taggedPosts = await kookee.blog.list({ tags: ['news', 'updates'] }); // Search posts const searchResults = await kookee.blog.list({ search: 'tutorial' }); // With locale const germanPosts = await kookee.blog.list({ locale: 'de', page: 1, limit: 10 }); ``` -------------------------------- ### Manage Help Center Content with Kookee SDK Source: https://github.com/kookee-dot-dev/kookee-ts-sdk/blob/main/README.md Demonstrates how to list categories and articles, filter articles by category, perform semantic search, retrieve articles by slug or ID, and get article translations. ```typescript // List categories const categories = await kookee.help.categories(); // List articles with pagination const articles = await kookee.help.list({ page: 1, limit: 10 }); // Filter by category slug const categoryArticles = await kookee.help.list({ category: 'getting-started' }); // Semantic search const results = await kookee.help.search({ query: 'how to reset password', limit: 5 }); // Get single article const article = await kookee.help.getBySlug('getting-started'); const articleById = await kookee.help.getById('article-uuid'); // Get article translations const translationsBySlug = await kookee.help.getTranslationsBySlug('getting-started'); const translationsById = await kookee.help.getTranslationsById('article-uuid'); ``` -------------------------------- ### Read Feedback Posts with Kookee TS SDK Source: https://github.com/kookee-dot-dev/kookee-ts-sdk/blob/main/README.md Explains how to list, filter, sort, and search feedback posts using the Kookee TS SDK. Includes fetching single posts with comments, voting, and getting top contributors. ```typescript // List feedback posts const posts = await kookee.feedback.list({ page: 1, limit: 10 }); // Filter by status: 'open' | 'under_review' | 'planned' | 'in_progress' | 'completed' | 'declined' const planned = await kookee.feedback.list({ status: 'planned' }); // Filter by category: 'feature' | 'improvement' | 'bug' | 'other' const bugs = await kookee.feedback.list({ category: 'bug' }); // Sort options: 'newest' | 'top' | 'trending' const trending = await kookee.feedback.list({ sort: 'trending' }); // Search posts const results = await kookee.feedback.list({ search: 'dark mode' }); // Get single post with comments const post = await kookee.feedback.getById('post-uuid'); // Vote on a post await kookee.feedback.vote('post-id', { action: 'upvote' }); // Get top contributors const contributors = await kookee.feedback.getTopContributors({ limit: 10 }); ``` -------------------------------- ### Manage Changelog Entries with Kookee SDK Source: https://github.com/kookee-dot-dev/kookee-ts-sdk/blob/main/README.md Provides examples for listing changelog entries with filtering, searching, ordering, retrieving by slug or ID, getting translations, and reacting to entries. ```typescript // List entries const entries = await kookee.changelog.list({ page: 1, limit: 10 }); // Filter by type: 'feature' | 'fix' | 'improvement' | 'breaking' | 'security' | 'deprecated' | 'other' const fixes = await kookee.changelog.list({ type: 'fix' }); // Search entries const results = await kookee.changelog.list({ search: 'authentication' }); // Order by version or date const sorted = await kookee.changelog.list({ orderBy: 'version', order: 'desc' }); // Get single entry const entry = await kookee.changelog.getBySlug('v1-0-0'); const entryById = await kookee.changelog.getById('entry-uuid'); // Get translations const translationsBySlug = await kookee.changelog.getTranslationsBySlug('v1-0-0'); const translationsById = await kookee.changelog.getTranslationsById('entry-uuid'); // React to an entry await kookee.changelog.react('entry-id', { reactionType: 'fire', action: 'add' }); ``` -------------------------------- ### Blog Module - Get Single Post Source: https://context7.com/kookee-dot-dev/kookee-ts-sdk/llms.txt Fetch a single blog post by its slug or ID, with optional locale and fallback support for translations. ```APIDOC ## Blog Module - Get Single Post Fetch a single blog post by slug or ID, with optional locale and fallback support for translations. ### Method `GET /blog/posts/{identifier}` ### Endpoint `/blog/posts/{identifier}` ### Parameters #### Path Parameters - **identifier** (string) - Required - The slug or ID of the blog post. #### Query Parameters - **locale** (string) - Optional - The locale code for fetching localized posts (e.g., 'en', 'de'). - **fallback** (boolean) - Optional - If true, falls back to the default locale if the requested translation is missing. ### Response #### Success Response (200) - **id** (string) - The unique identifier of the post. - **slug** (string) - The slug of the post. - **title** (string) - The title of the post. - **contentHtml** (string) - The HTML content of the post. - **excerptHtml** (string) - The HTML excerpt of the post. - **coverImageUrl** (string) - The URL of the cover image. - **status** (string) - The publication status of the post (e.g., 'published'). - **publishedAt** (string) - The publication date and time. - **author** (object) - Information about the author. - **name** (string) - The author's name. - **tags** (array) - An array of tags associated with the post. - **name** (string) - The tag name. - **slug** (string) - The tag slug. - **reactions** (object) - Emoji reaction counts. - **views** (number) - The number of views. - **locale** (string) - The locale of the post. - **translationGroupId** (string) - The ID of the translation group. #### Response Example ```json { "id": "uuid", "slug": "hello-world", "title": "Hello World", "contentHtml": "
Post content...
", "excerptHtml": "Excerpt...
", "coverImageUrl": "https://...", "status": "published", "publishedAt": "2024-01-15T10:30:00Z", "author": { "name": "John Doe" }, "tags": [{ "name": "News", "slug": "news" }], "reactions": { "heart": 5, "fire": 2 }, "views": 150, "locale": "en", "translationGroupId": "group-uuid" } ``` ``` -------------------------------- ### Blog Module: Get Single Post by Slug or ID Source: https://context7.com/kookee-dot-dev/kookee-ts-sdk/llms.txt Illustrates fetching a single blog post using its slug or unique ID. It also demonstrates how to retrieve a post in a specific locale and enable fallback to the default locale if the translation is not available. ```typescript // Get post by slug const post = await kookee.blog.getBySlug('hello-world'); // Returns: { // id: 'uuid', // slug: 'hello-world', // title: 'Hello World', // contentHtml: 'Post content...
', // excerptHtml: 'Excerpt...
', // coverImageUrl: 'https://...', // status: 'published', // publishedAt: '2024-01-15T10:30:00Z', // author: { name: 'John Doe' }, // tags: [{ name: 'News', slug: 'news' }], // reactions: { heart: 5, fire: 2 }, // views: 150, // locale: 'en', // translationGroupId: 'group-uuid' // } // Get post by ID const postById = await kookee.blog.getById('post-uuid'); // Get with locale and fallback const germanPost = await kookee.blog.getBySlug('hello-world', { locale: 'de', fallback: true // Falls back to default locale if translation missing }); ``` -------------------------------- ### Get Single Help Center Article Source: https://context7.com/kookee-dot-dev/kookee-ts-sdk/llms.txt Fetch a specific help center article using its slug or unique ID. This function also retrieves vote counts for article usefulness and can fetch available translations for an article. Ensure the article identifier is correct. ```typescript // Get article by slug const article = await kookee.help.getBySlug('getting-started'); // Returns: { // id: 'uuid', // slug: 'getting-started', // title: 'Getting Started Guide', // contentHtml: 'Article content...
', // excerptHtml: 'Brief excerpt...
', // category: { name: 'Getting Started', slug: 'getting-started' }, // author: { name: 'Support Team' }, // usefulYesCount: 42, // usefulNoCount: 3, // views: 1500, // locale: 'en' // } // Get article by ID const articleById = await kookee.help.getById('article-uuid'); // Get translations const translations = await kookee.help.getTranslationsBySlug('getting-started'); ``` -------------------------------- ### Initialize Kookee SDK Source: https://github.com/kookee-dot-dev/kookee-ts-sdk/blob/main/README.md Demonstrates how to initialize the Kookee SDK with an API key. ```typescript import { Kookee } from '@kookee/sdk'; const kookee = new Kookee({ apiKey: 'your-api-key', }); ``` -------------------------------- ### Initialize Kookee Client with API Key or Project ID Source: https://context7.com/kookee-dot-dev/kookee-ts-sdk/llms.txt Demonstrates how to create an instance of the Kookee client using either an API key for authenticated access or a project ID for public read-only access. Includes a health check to verify the connection. ```typescript import { Kookee, KookeeApiError } from '@kookee/sdk'; // Initialize the client with API key const kookee = new Kookee({ apiKey: 'your-api-key', }); // Alternative: Initialize with project ID only (for public read-only access) const kookeePublic = new Kookee({ projectId: 'your-project-id', }); // Health check to verify connection const health = await kookee.health(); // Returns: { status: 'ok', projectId: '...', timestamp: '2024-01-15T10:30:00Z' } ``` -------------------------------- ### List Help Center Categories and Articles Source: https://context7.com/kookee-dot-dev/kookee-ts-sdk/llms.txt Retrieve a list of all help center categories and articles. Supports filtering by category, searching by keywords, and pagination for article listings. Requires the kookee SDK to be initialized. ```typescript // List all categories const categories = await kookee.help.categories(); // Returns: [ // { slug: 'getting-started', name: 'Getting Started', description: '...', icon: '🚀', articleCount: 5 }, // { slug: 'account', name: 'Account', description: '...', icon: '👤', articleCount: 8 } // ] // List articles with pagination const articles = await kookee.help.list({ page: 1, limit: 10 }); // Filter by category slug const categoryArticles = await kookee.help.list({ category: 'getting-started' }); // Search within help articles const searchResults = await kookee.help.list({ search: 'password reset' }); ``` -------------------------------- ### Help Center - Categories and Articles Source: https://context7.com/kookee-dot-dev/kookee-ts-sdk/llms.txt Retrieve help center categories and list articles. Supports filtering by category, search queries, and pagination. ```APIDOC ## Help Center - Categories and Articles ### Description Retrieve help center categories and list articles with filtering by category, search, and pagination. ### Method GET ### Endpoint `/help/categories` (for categories) `/help/articles` (for articles) ### Query Parameters - **page** (integer) - Optional - The page number for pagination. - **limit** (integer) - Optional - The number of articles to return per page. - **category** (string) - Optional - The slug of the category to filter articles by. - **search** (string) - Optional - A search term to find relevant articles. ### Response #### Success Response (200) - **categories** (array) - A list of category objects, each containing `slug`, `name`, `description`, `icon`, and `articleCount`. - **articles** (array) - A list of article objects, each containing details like `id`, `slug`, `title`, `excerptHtml`, `category`, `author`, `usefulYesCount`, `usefulNoCount`, `views`, and `locale`. ### Request Example ```typescript // List all categories const categories = await kookee.help.categories(); // List articles with pagination const articles = await kookee.help.list({ page: 1, limit: 10 }); // Filter by category slug const categoryArticles = await kookee.help.list({ category: 'getting-started' }); // Search within help articles const searchResults = await kookee.help.list({ search: 'password reset' }); ``` ``` -------------------------------- ### Fetch Blog Posts with Kookee SDK Source: https://github.com/kookee-dot-dev/kookee-ts-sdk/blob/main/README.md Shows how to fetch a list of blog posts and retrieve a single post by its slug using the Kookee SDK. ```typescript // Fetch blog posts const posts = await kookee.blog.list({ limit: 10 }); // Get a single post by slug const post = await kookee.blog.getBySlug('hello-world'); ``` -------------------------------- ### Help Center - Semantic Search Source: https://context7.com/kookee-dot-dev/kookee-ts-sdk/llms.txt Perform AI-powered semantic search across help articles to find relevant content based on meaning. ```APIDOC ## Help Center - Semantic Search ### Description Perform AI-powered semantic search across help articles to find relevant content based on meaning. ### Method POST ### Endpoint `/help/search` ### Request Body - **query** (string) - Required - The search query. - **limit** (integer) - Optional - The maximum number of results to return. ### Request Example ```typescript const results = await kookee.help.search({ query: 'how to reset my password', limit: 5 }); ``` ### Response #### Success Response (200) - **results** (array) - A list of ranked search results, each containing `id`, `slug`, `title`, `excerptHtml`, `category` (object), `matchedChunk`, `locale`, `usefulYesCount`, and `usefulNoCount`. ``` -------------------------------- ### Manage Configuration with Kookee TS SDK Source: https://github.com/kookee-dot-dev/kookee-ts-sdk/blob/main/README.md Demonstrates how to retrieve single configuration values by key and multiple configuration values by a list of keys using the Kookee TS SDK. ```typescript // Get a single config value const config = await kookee.config.getByKey('feature_flags'); // Get multiple config values const configs = await kookee.config.list({ keys: ['feature_flags', 'theme'] }); ``` -------------------------------- ### Blog Module - List Posts Source: https://context7.com/kookee-dot-dev/kookee-ts-sdk/llms.txt Retrieve paginated blog posts with support for filtering by tags, search queries, and pagination options. ```APIDOC ## Blog Module - List Posts Retrieve paginated blog posts with support for filtering by tags, search queries, and pagination options. ### Method `GET /blog/posts` ### Endpoint `/blog/posts` ### Query Parameters - **page** (number) - Optional - The page number for pagination. - **limit** (number) - Optional - The number of posts to return per page. - **tags** (string[]) - Optional - An array of tag slugs to filter posts by. - **search** (string) - Optional - A search query to filter posts. - **locale** (string) - Optional - The locale code for fetching localized posts (e.g., 'en', 'de'). ### Response #### Success Response (200) - **data** (array) - An array of `BlogPostListItem` objects. - **total** (number) - The total number of posts available. - **limit** (number) - The limit of posts per page. - **offset** (number) - The offset for pagination. - **page** (number) - The current page number. - **totalPages** (number) - The total number of pages. #### Response Example ```json { "data": [ { "id": "uuid", "slug": "example-post", "title": "Example Post Title", "excerptHtml": "Excerpt...
", "coverImageUrl": "https://...", "publishedAt": "2024-01-15T10:30:00Z", "author": { "name": "John Doe" }, "tags": [{ "name": "News", "slug": "news" }], "reactions": { "heart": 5 }, "views": 150, "locale": "en" } ], "total": 42, "limit": 10, "offset": 0, "page": 1, "totalPages": 5 } ``` ``` -------------------------------- ### Include Code Block Styling (TypeScript) Source: https://context7.com/kookee-dot-dev/kookee-ts-sdk/llms.txt Shows how to import optional CSS for styling code blocks within HTML content, using the VS Code Dark+ theme. This can be done directly in the application's entry point using TypeScript. ```typescript // Import in your app entry point import '@kookee/sdk/styles/code.css'; ``` -------------------------------- ### Import Code Block Styling CSS (TypeScript) Source: https://github.com/kookee-dot-dev/kookee-ts-sdk/blob/main/README.md Shows how to import the optional CSS file provided by the Kookee SDK for styling code blocks. This import enables features like syntax highlighting and a copy-to-clipboard button. ```typescript import '@kookee/sdk/styles/code.css'; ``` -------------------------------- ### Perform AI Semantic Search on Help Articles Source: https://context7.com/kookee-dot-dev/kookee-ts-sdk/llms.txt Conduct an AI-powered semantic search across help articles to find content based on meaning, not just keywords. This returns ranked results, including matched content chunks, article details, and locale information. Specify a limit for the number of results. ```typescript // Semantic search returns ranked results with matched content chunks const results = await kookee.help.search({ query: 'how to reset my password', limit: 5 }); // Returns: [ // { // id: 'uuid', // slug: 'password-reset', // title: 'How to Reset Your Password', // excerptHtml: 'Learn how to...
', // category: { name: 'Account', slug: 'account' }, // matchedChunk: '...click the "Forgot Password" link...', // locale: 'en', // usefulYesCount: 25, // usefulNoCount: 2 // } // ] ``` -------------------------------- ### Blog Module - Tags and Translations Source: https://context7.com/kookee-dot-dev/kookee-ts-sdk/llms.txt Retrieve all blog tags with post counts and fetch all available translations for a post. ```APIDOC ## Blog Module - Tags and Translations Retrieve all blog tags with post counts and fetch all available translations for a post. ### Method `GET /blog/tags` and `GET /blog/posts/{identifier}/translations` ### Endpoints - `/blog/tags` - `/blog/posts/{identifier}/translations` ### Description #### Get All Tags Retrieves a list of all available tags with the count of posts associated with each tag. ##### Response (200) - **name** (string) - The name of the tag. - **slug** (string) - The slug of the tag. - **count** (number) - The number of posts associated with the tag. ##### Response Example ```json [ { "name": "News", "slug": "news", "count": 15 }, { "name": "Tutorials", "slug": "tutorials", "count": 8 } ] ``` #### Get Post Translations Retrieves all available translations for a specific blog post, identified by its slug or ID. ##### Parameters - **identifier** (string) - Required - The slug or ID of the blog post. ##### Response (200) - An object where keys are locale codes (e.g., 'en', 'de') and values are `BlogPost` objects for that locale. ##### Response Example ```json { "en": { ... BlogPost object for English ... }, "de": { ... BlogPost object for German ... }, "fr": { ... BlogPost object for French ... } } ``` ``` -------------------------------- ### Client Initialization Source: https://context7.com/kookee-dot-dev/kookee-ts-sdk/llms.txt Initialize the Kookee client with your API key or project ID to access SDK modules. Includes a health check endpoint. ```APIDOC ## Client Initialization Create a Kookee client instance with your API key to access all SDK modules including blog, help center, changelog, announcements, feedback, pages, and config. ### Method `new Kookee(options: { apiKey?: string; projectId?: string })` ### Parameters #### Request Body - **apiKey** (string) - Optional - Your Kookee API key for authenticated access. - **projectId** (string) - Optional - Your Kookee project ID for public read-only access. ### Request Example ```typescript import { Kookee } from '@kookee/sdk'; // Initialize with API key const kookee = new Kookee({ apiKey: 'your-api-key' }); // Initialize with project ID only const kookeePublic = new Kookee({ projectId: 'your-project-id' }); ``` ### Endpoint N/A (Constructor) ### Health Check #### Method `GET /health` #### Endpoint `/health` #### Description Performs a health check to verify the connection to the Kookee API. #### Response ##### Success Response (200) - **status** (string) - The status of the health check (e.g., 'ok'). - **projectId** (string) - The ID of the project. - **timestamp** (string) - The timestamp of the health check. #### Response Example ```json { "status": "ok", "projectId": "your-project-id", "timestamp": "2024-01-15T10:30:00Z" } ``` ``` -------------------------------- ### Code Block Styles Source: https://context7.com/kookee-dot-dev/kookee-ts-sdk/llms.txt Instructions for styling code blocks using provided CSS. ```APIDOC ## Code Block Styles Import the optional CSS file to style code blocks in content HTML with VS Code Dark+ theme. ### Importing CSS **Via JavaScript/TypeScript:** ```typescript // Import in your app entry point import '@kookee/sdk/styles/code.css'; ``` **Via CDN:** ```html ``` ``` -------------------------------- ### Blog Module: Add or Remove Reactions Source: https://context7.com/kookee-dot-dev/kookee-ts-sdk/llms.txt Demonstrates how to interact with emoji reactions on blog posts. This includes adding a specific reaction type (e.g., 'heart') and removing an existing reaction, updating the reaction counts. ```typescript // Add a reaction const response = await kookee.blog.react('post-id', { reactionType: 'heart', action: 'add' }); // Returns: { reactions: { heart: 6, fire: 2, rocket: 1 } } // Remove a reaction await kookee.blog.react('post-id', { reactionType: 'heart', action: 'remove' }); ``` -------------------------------- ### List and Manage Pages with Kookee TS SDK Source: https://github.com/kookee-dot-dev/kookee-ts-sdk/blob/main/README.md Shows how to list, search, and retrieve pages by slug or ID using the Kookee TS SDK. Also covers fetching page translations. ```typescript // List pages const pages = await kookee.pages.list({ page: 1, limit: 10 }); // Search pages const results = await kookee.pages.list({ search: 'privacy' }); // Get single page const page = await kookee.pages.getBySlug('privacy-policy'); const pageById = await kookee.pages.getById('page-uuid'); // Get translations const translationsBySlug = await kookee.pages.getTranslationsBySlug('privacy-policy'); const translationsById = await kookee.pages.getTranslationsById('page-uuid'); ``` -------------------------------- ### Help Center - AI Chat Source: https://context7.com/kookee-dot-dev/kookee-ts-sdk/llms.txt Use AI-powered chat to answer user questions with context from help articles. Supports both standard and streaming responses. ```APIDOC ## Help Center - AI Chat ### Description Use AI-powered chat to answer user questions with context from help articles. Supports both standard and streaming responses. ### Method POST ### Endpoint `/help/chat` (standard) `/help/chat/stream` (streaming) ### Request Body - **messages** (array) - Required - An array of message objects, each with `role` ('user' or 'assistant') and `content` (string). - **sessionId** (string) - Optional - An identifier to maintain conversation context. - **locale** (string) - Optional - The language for the chat response. ### Request Example ```typescript // Standard chat request const response = await kookee.help.chat({ messages: [{ role: 'user', content: 'How do I reset my password?' }], sessionId: 'optional-session-id', locale: 'en' }); // Streaming chat request for await (const chunk of kookee.help.chatStream({ messages: [{ role: 'user', content: 'How do I reset my password?' }] })) { // Process chunks (delta, sources, done, error) } ``` ### Response #### Success Response (200) - Standard Chat - **message** (string) - The AI-generated response. - **sources** (array) - A list of source articles used for the response, each containing `id`, `slug`, `title`, `visibility`, and `category`. #### Success Response (200) - Streaming Chat - **chunk** (object) - Contains `type` ('delta', 'sources', 'done', 'error') and `content` or `sources` or `message` depending on the type. ``` -------------------------------- ### AI Chat and Streaming with Kookee SDK Source: https://github.com/kookee-dot-dev/kookee-ts-sdk/blob/main/README.md Shows how to use the AI-powered chat feature for the Help Center, including standard chat and streaming responses, and how to vote on article usefulness. ```typescript // AI-powered chat const response = await kookee.help.chat({ messages: [{ role: 'user', content: 'How do I reset my password?' }], sessionId: 'optional-session-id', // maintain conversation context across calls }); // Streaming chat for await (const chunk of kookee.help.chatStream({ messages })) { if (chunk.type === 'delta') console.log(chunk.content); if (chunk.type === 'sources') console.log('Sources:', chunk.sources); if (chunk.type === 'done') console.log('Stream finished'); if (chunk.type === 'error') console.error(chunk.message); } // Vote on article usefulness await kookee.help.voteUsefulness('article-id', 'yes'); // Change a previous vote await kookee.help.voteUsefulness('article-id', 'no', 'yes'); // Remove a vote await kookee.help.voteUsefulness('article-id', null, 'yes'); ``` -------------------------------- ### Create and Manage Feedback Posts and Comments (TypeScript) Source: https://context7.com/kookee-dot-dev/kookee-ts-sdk/llms.txt Demonstrates how to create feedback posts and comments using an external user identifier. It covers creating posts, adding comments, listing user-specific posts, and deleting posts or comments. Requires the '@kookee/sdk' package. ```typescript import type { ExternalUser } from '@kookee/sdk'; // Define the external user (from your app's authentication) const user: ExternalUser = { externalId: 'user-123', // Your system's user ID name: 'Jane Doe', email: 'jane@example.com', // Optional avatarUrl: 'https://...', // Optional }; // Create a feedback post const newPost = await kookee.feedback.createPost({ title: 'Add dark mode', description: 'It would be great to have a dark mode option.', category: 'feature', // Optional: 'feature' | 'improvement' | 'bug' | 'other' externalUser: user, }); // Returns: { id: 'uuid', title: '...', status: 'open', voteCount: 0, ... } // Add a comment to a post const comment = await kookee.feedback.createComment('post-id', { content: 'Great idea, I would love this too!', externalUser: user, }); // List posts created by a specific user const myPosts = await kookee.feedback.listMyPosts({ externalId: 'user-123', page: 1, limit: 10, status: 'open', // Optional filter category: 'feature', // Optional filter search: 'dark mode', // Optional search sort: 'newest', // Optional sort }); // Delete a post (only the author can delete) await kookee.feedback.deletePost('post-id', { externalId: 'user-123' }); // Delete a comment (only the author can delete) await kookee.feedback.deleteComment('comment-id', { externalId: 'user-123' }); ``` -------------------------------- ### Help Center - Vote Usefulness Source: https://context7.com/kookee-dot-dev/kookee-ts-sdk/llms.txt Allow users to vote on article helpfulness with yes/no/null votes, supporting vote changes. ```APIDOC ## Help Center - Vote Usefulness ### Description Allow users to vote on article helpfulness with yes/no/null votes, supporting vote changes. ### Method POST ### Endpoint `/help/articles/{articleId}/vote` ### Parameters #### Path Parameters - **articleId** (string) - Required - The ID of the article to vote on. ### Request Body - **vote** (string | null) - Required - The vote ('yes', 'no', or null to remove vote). - **previousVote** (string | null) - Optional - The previous vote ('yes' or 'no') if changing a vote. ### Request Example ```typescript // Vote article as helpful const result = await kookee.help.voteUsefulness('article-id', 'yes'); // Change a previous vote await kookee.help.voteUsefulness('article-id', 'no', 'yes'); // Remove a vote await kookee.help.voteUsefulness('article-id', null, 'no'); ``` ### Response #### Success Response (200) - **usefulYesCount** (integer) - The updated count of 'yes' votes. - **usefulNoCount** (integer) - The updated count of 'no' votes. ``` -------------------------------- ### Import TypeScript Type Definitions (TypeScript) Source: https://github.com/kookee-dot-dev/kookee-ts-sdk/blob/main/README.md Illustrates importing various type definitions from the Kookee SDK for use in TypeScript projects. This ensures type safety and provides autocompletion for SDK elements. ```typescript import type { BlogPost, BlogPostListItem, BlogTag, BlogTagWithCount, Page, PageListItem, HelpArticle, HelpArticleListItem, HelpCategory, HelpSearchResult, HelpChatResponse, HelpChatStreamChunk, ChangelogEntry, ChangelogEntryListItem, Announcement, AnnouncementListItem, FeedbackPost, FeedbackPostListItem, FeedbackComment, FeedbackTopContributor, ExternalUser, PublicConfig, PaginatedResponse, KookeeConfig, } from '@kookee/sdk'; ``` -------------------------------- ### Import TypeScript Types for SDK Responses (TypeScript) Source: https://context7.com/kookee-dot-dev/kookee-ts-sdk/llms.txt Demonstrates importing various TypeScript types provided by the '@kookee/sdk' package to ensure type safety when working with SDK responses for different modules like Blog, Help Center, Feedback, and Configuration. ```typescript import type { BlogPost, BlogPostListItem, BlogTag, BlogTagWithCount, Page, PageListItem, HelpArticle, HelpArticleListItem, HelpCategory, HelpSearchResult, HelpChatResponse, HelpChatStreamChunk, ChangelogEntry, ChangelogEntryListItem, ChangelogType, Announcement, AnnouncementListItem, AnnouncementType, FeedbackPost, FeedbackPostListItem, FeedbackComment, FeedbackTopContributor, FeedbackPostStatus, FeedbackPostCategory, ExternalUser, PublicConfig, PaginatedResponse, KookeeConfig, ReactionType, } from '@kookee/sdk'; ``` -------------------------------- ### Add and Remove Reactions with Kookee TS SDK Source: https://github.com/kookee-dot-dev/kookee-ts-sdk/blob/main/README.md Illustrates how to add or remove reactions (e.g., 'fire', 'heart') to blog posts and changelog entries using the Kookee TS SDK. ```typescript // Available reaction types: 'fire' | 'heart' | 'rocket' | 'eyes' | 'mindblown' await kookee.blog.react('post-id', { reactionType: 'heart', action: 'add' }); // Remove a reaction await kookee.blog.react('post-id', { reactionType: 'heart', action: 'remove' }); ``` -------------------------------- ### Config Module Source: https://context7.com/kookee-dot-dev/kookee-ts-sdk/llms.txt APIs for retrieving public configuration values. ```APIDOC ## Config Module Retrieve public configuration values for feature flags, themes, or other app settings. ### Get Config Value by Key **Method:** GET **Endpoint:** `/config/{key}` **Description:** Retrieves a single configuration value by its key. **Parameters:** #### Path Parameters - **key** (string) - Required - The key of the configuration value to retrieve. #### Response ##### Success Response (200) - **key** (string) - The key of the configuration value. - **value** (any) - The configuration value. ### Request Example ```json { "key": "feature_flags", "value": { "dark_mode": true, "beta_features": false } } ``` ### List Config Values by Keys **Method:** POST **Endpoint:** `/config/list` **Description:** Retrieves multiple configuration values by a list of keys. **Parameters:** #### Request Body - **keys** (array of strings) - Required - An array of configuration keys to retrieve. ### Request Example ```json { "keys": ["feature_flags", "theme"] } ``` #### Response ##### Success Response (200) - An array of objects, where each object contains: - **key** (string) - The key of the configuration value. - **value** (any) - The configuration value. ### Response Example ```json [ { "key": "feature_flags", "value": { "dark_mode": true, "beta_features": false } }, { "key": "theme", "value": { "primary_color": "#007bff" } } ] ``` ``` -------------------------------- ### Include Code Block Styling via CDN (HTML) Source: https://github.com/kookee-dot-dev/kookee-ts-sdk/blob/main/README.md Provides the HTML snippet to include the Kookee SDK's code block styling via a CDN link. This method is an alternative to direct import and offers similar styling benefits for code blocks. ```html ``` -------------------------------- ### Feedback Module Source: https://context7.com/kookee-dot-dev/kookee-ts-sdk/llms.txt APIs for creating and managing feedback posts and comments using an external user identifier. ```APIDOC ## Feedback Module - Creating and Managing Feedback Create feedback posts and comments using an external user identifier from your application. ### Create Feedback Post **Method:** POST **Endpoint:** `/feedback/posts` **Description:** Creates a new feedback post. **Parameters:** #### Request Body - **title** (string) - Required - The title of the feedback post. - **description** (string) - Required - The detailed description of the feedback. - **category** (string) - Optional - The category of the feedback ('feature', 'improvement', 'bug', 'other'). - **externalUser** (object) - Required - Information about the user providing the feedback. - **externalId** (string) - Required - Your system's user ID. - **name** (string) - Required - The user's name. - **email** (string) - Optional - The user's email address. - **avatarUrl** (string) - Optional - The URL of the user's avatar. ### Request Example ```json { "title": "Add dark mode", "description": "It would be great to have a dark mode option.", "category": "feature", "externalUser": { "externalId": "user-123", "name": "Jane Doe", "email": "jane@example.com", "avatarUrl": "https://..." } } ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier of the created post. - **title** (string) - The title of the post. - **description** (string) - The description of the post. - **status** (string) - The status of the post (e.g., 'open'). - **voteCount** (integer) - The number of votes the post has received. ### Create Feedback Comment **Method:** POST **Endpoint:** `/feedback/posts/{postId}/comments` **Description:** Adds a comment to an existing feedback post. **Parameters:** #### Path Parameters - **postId** (string) - Required - The ID of the post to comment on. #### Request Body - **content** (string) - Required - The content of the comment. - **externalUser** (object) - Required - Information about the user making the comment. - **externalId** (string) - Required - Your system's user ID. - **name** (string) - Required - The user's name. - **email** (string) - Optional - The user's email address. - **avatarUrl** (string) - Optional - The URL of the user's avatar. ### Request Example ```json { "content": "Great idea, I would love this too!", "externalUser": { "externalId": "user-123", "name": "Jane Doe" } } ``` ### List User's Feedback Posts **Method:** GET **Endpoint:** `/feedback/users/{externalId}/posts` **Description:** Retrieves a list of feedback posts created by a specific user. **Parameters:** #### Path Parameters - **externalId** (string) - Required - The external ID of the user. #### Query Parameters - **page** (integer) - Optional - The page number for pagination. - **limit** (integer) - Optional - The number of items per page. - **status** (string) - Optional - Filter posts by status (e.g., 'open'). - **category** (string) - Optional - Filter posts by category. - **search** (string) - Optional - Search query for posts. - **sort** (string) - Optional - Sorting order (e.g., 'newest'). ### Delete Feedback Post **Method:** DELETE **Endpoint:** `/feedback/posts/{postId}` **Description:** Deletes a feedback post. Only the author can delete their post. **Parameters:** #### Path Parameters - **postId** (string) - Required - The ID of the post to delete. #### Request Body - **externalUser** (object) - Required - Information about the user attempting to delete. - **externalId** (string) - Required - Your system's user ID. ### Delete Feedback Comment **Method:** DELETE **Endpoint:** `/feedback/comments/{commentId}` **Description:** Deletes a feedback comment. Only the author can delete their comment. **Parameters:** #### Path Parameters - **commentId** (string) - Required - The ID of the comment to delete. #### Request Body - **externalUser** (object) - Required - Information about the user attempting to delete. - **externalId** (string) - Required - Your system's user ID. ``` -------------------------------- ### Handle Localization with Kookee TS SDK Source: https://github.com/kookee-dot-dev/kookee-ts-sdk/blob/main/README.md Explains how to specify locales for API requests and handle fallback mechanisms for translations using the Kookee TS SDK. Also shows how to retrieve all translations for a given resource. ```typescript // Specify locale const posts = await kookee.blog.list({ locale: 'de' }); // With fallback to default locale if translation doesn't exist const post = await kookee.blog.getBySlug('hello-world', { locale: 'de', fallback: true }); // Translation endpoints return a Record