### Kookee SDK Setup Source: https://context7_llms Instructions on how to install and set up the Kookee SDK in your project. ```APIDOC ## Kookee SDK ### Installation Install the SDK using your preferred package manager: ```bash npm install @kookee/sdk # or pnpm add @kookee/sdk # or yarn add @kookee/sdk # or bun add @kookee/sdk ``` ### Setup Import and initialize the Kookee client with your API key. ```typescript import { Kookee } from '@kookee/sdk'; const kookee = new Kookee({ apiKey: process.env.KOOKEE_API_KEY!, // baseUrl: 'https://api.kookee.dev/v1' // Optional: Custom API base URL }); // Example usage: // const { data: posts } = await kookee.blog.list(); ``` ### Constructor Options - **apiKey** (string, required) - Your project's API key. - **baseUrl** (string, optional) - A custom URL for the Kookee API endpoint. Defaults to `https://api.kookee.dev/v1`. ``` -------------------------------- ### Full KookeeChatWidget Example with Customization Source: https://context7_llms Provides a comprehensive example of the KookeeChatWidget with various customization props. This includes setting position, theme, primary color, greeting message, placeholder, suggestions, locale, and an `onSourceClick` callback. ```javascript import { KookeeChatWidget } from '@kookee/react'; import '@kookee/react/styles.css'; function App() { return ( { window.open(`/help/${source.slug}`, '_blank'); }} /> ); } ``` -------------------------------- ### Full KookeeChat Inline Example with Props in React Source: https://context7_llms Provides a comprehensive example of using the KookeeChat component with various props, including API key, greeting message, placeholder, suggestions, locale, and an event handler for source clicks. The example also demonstrates styling the parent container for optimal layout. ```jsx import { KookeeChat } from '@kookee/react'; import '@kookee/react/styles.css'; function SupportPage() { return (
{ window.location.href = `/help/${source.slug}`; }} />
); } ``` -------------------------------- ### Business Rules Example (JavaScript) Source: https://context7_llms Shows an example of using the Config module to manage business rules, such as discount percentages and minimum order values. This allows for flexible adjustments to business logic without code changes. ```javascript const discount = await kookee.config.getByKey('pricing-discount'); // { percentage: 20, minOrderValue: 50 } ``` -------------------------------- ### Full HTML Example with Kookee SDK Blog Integration Source: https://context7_llms This is a complete HTML example demonstrating how to load the Kookee SDK via CDN and use it to fetch and display the latest blog posts. It includes basic HTML structure, script inclusion, SDK initialization, and an asynchronous function to load and render posts. ```html My Blog

Latest Posts

``` -------------------------------- ### Setup Kookee SDK in React Source: https://context7_llms Initializes the Kookee SDK client with an API key, typically stored in environment variables. This setup is crucial for all subsequent interactions with the Kookee API. ```typescript import { Kookee } from '@kookee/sdk'; export const kookee = new Kookee({ apiKey: process.env.NEXT_PUBLIC_KOOKEE_API_KEY!, }); ``` -------------------------------- ### Get Multiple Config Values Example (JavaScript) Source: https://context7_llms Illustrates fetching multiple configuration values using the `list` method with specific keys. The output shows an array of config objects, each with a key and its corresponding value, including different data types like numbers and arrays. ```javascript const configs = await kookee.config.list({ keys: ['max-upload-size', 'allowed-file-types', 'feature-dark-mode'], }); // [ // { key: 'max-upload-size', value: 10485760 }, // { key: 'allowed-file-types', value: ['jpg', 'png', 'pdf'] }, // { key: 'feature-dark-mode', value: true }, // ] ``` -------------------------------- ### Install Kookee SDK using npm Source: https://context7_llms This command installs the Kookee SDK, which is necessary for interacting with the Kookee API from your application. It supports various package managers like npm, pnpm, yarn, and bun. ```bash npm install @kookee/sdk # or: pnpm add / yarn add / bun add ``` -------------------------------- ### Full Example: Custom Chat UI with Kookee Source: https://context7_llms A comprehensive example demonstrating how to build a custom chat UI using `KookeeChatProvider` and `useKookeeChat`. It includes message display, input handling, sending messages, and clearing the chat. ```javascript import { KookeeChatProvider, useKookeeChat } from '@kookee/react'; import { useState } from 'react'; function MyChatUI() { const { messages, isLoading, sendMessage, clearMessages } = useKookeeChat(); const [input, setInput] = useState(''); const handleSubmit = (e) => { e.preventDefault(); if (!input.trim()) return; sendMessage(input); setInput(''); }; return (
{messages.map((msg) => (
{msg.role}:

{msg.content}

{msg.isStreaming && typing...} {msg.sources?.map((s) => ( {s.title} ))}
))}
setInput(e.target.value)} placeholder="Ask a question..." disabled={isLoading} />
); } function App() { return ( ); } ``` -------------------------------- ### Install KookeeChatWidget using npm Source: https://context7_llms Installs the necessary Kookee React and SDK packages using npm. This is the first step to integrate the chat widget into your project. ```bash npm install @kookee/react @kookee/sdk ``` -------------------------------- ### TypeScript Type Inference Examples Source: https://context7_llms Illustrates how TypeScript infers types for common Kookee API calls. These examples show the expected return types for listing blog posts, getting a post by slug, and fetching help categories. ```typescript // Example: Listing blog posts const response = await kookee.blog.list(); // Expected type: PaginatedResponse // Example: Getting a blog post by slug const post = await kookee.blog.getBySlug('my-post'); // Expected type: BlogPost // Example: Fetching help categories const categories = await kookee.help.categories(); // Expected type: HelpCategory[] ``` -------------------------------- ### Get Single Config Value Example (JavaScript) Source: https://context7_llms Provides a concrete example of fetching a single configuration value for 'feature-dark-mode' and accessing its key and value properties. The value is demonstrated to be a boolean. ```javascript const config = await kookee.config.getByKey('feature-dark-mode'); config.key; // "feature-dark-mode" config.value; // true ``` -------------------------------- ### List Blog Posts (Python Requests) Source: https://context7_llms Provides a Python example using the `requests` library to retrieve a list of blog posts. It demonstrates setting the API key in the request headers and handling the JSON response. The API key should be stored securely, for example, in environment variables. ```python import requests, os response = requests.get( 'https://api.kookee.dev/v1/blog/posts', headers={'Kookee-API-Key': os.environ['KOOKEE_API_KEY']} ) data = response.json() ``` -------------------------------- ### Setup Kookee SDK in Vue Composables Source: https://context7_llms Initializes the Kookee SDK instance with an API key from environment variables and exports a composable function to access it. This setup is crucial for all subsequent SDK interactions within a Vue application. ```typescript import { Kookee } from '@kookee/sdk'; const kookee = new Kookee({ apiKey: import.meta.env.VITE_KOOKEE_API_KEY, }); export function useKookee() { return kookee; } ``` -------------------------------- ### CDN Setup and Initialization Source: https://context7_llms Instructions on how to include the Kookee SDK via CDN and initialize the SDK client with your API key. ```APIDOC ## CDN Setup and Initialization ### Description Include the Kookee SDK script in your HTML and initialize the Kookee client with your API key. You can use the latest version or pin to a specific version. ### Method JavaScript (Client-side) ### Endpoint N/A ### Parameters #### Constructor Options - **apiKey** (string, required) - Your project API key. - **baseUrl** (string, optional) - Custom API base URL. ### Request Example ```html ``` ### Response N/A ``` -------------------------------- ### Blog Module - List Posts Source: https://context7_llms Example of fetching a list of blog posts using the Kookee SDK, with options for limiting the number of posts. ```APIDOC ## Blog Module - List Posts ### Description Fetches a list of blog posts. You can specify the number of posts to retrieve using the `limit` option. ### Method `kookee.blog.list(options?: { limit?: number }): Promise<{ data: Post[] }> ` ### Endpoint N/A (SDK Method) ### Parameters #### Options - **limit** (number, optional) - The maximum number of posts to return. ### Request Example ```javascript const { data: posts } = await kookee.blog.list({ limit: 5 }); console.log(posts); ``` ### Response #### Success Response (200) - **data** (Array) - An array of blog post objects. #### Response Example ```json { "data": [ { "id": "post-1", "title": "First Blog Post", "slug": "first-blog-post", "excerpt": "This is the excerpt...", "publishedAt": "2023-01-01T10:00:00Z" // ... other post properties } ] } ``` ``` -------------------------------- ### Preloading Config at Startup Source: https://context7_llms Shows how to preload multiple configurations at application startup using `kookee.config.list()`. The fetched configurations are then mapped into a `Map` for easy access. ```javascript const configs = await kookee.config.list({ keys: ['feature-dark-mode', 'upload-settings', 'promo-banner'], }); const configMap = new Map(configs.map(c => [c.key, c.value])); const isDarkMode = configMap.get('feature-dark-mode') as boolean; ``` -------------------------------- ### UI Configuration Example (JavaScript) Source: https://context7_llms Illustrates how to use the Config module for UI configuration. It fetches an object containing UI-related settings like text, color, and enabled status, allowing for dynamic customization of the user interface. ```javascript const banner = await kookee.config.getByKey('homepage-banner'); // { text: "Summer Sale!", enabled: true, color: "#ff6b00" } ``` -------------------------------- ### Kookee SDK Blog Module Quick Reference Source: https://context7_llms A quick reference guide for the Blog module of the Kookee SDK, listing available methods for fetching posts, managing reactions, and retrieving translations. Assumes the SDK has been initialized. ```javascript // List posts (pagination, tags, search, locale) await kookee.blog.list(params?) // Get post by slug await kookee.blog.getBySlug(slug, options?) // Get post by ID await kookee.blog.getById(id, options?) // List tags with counts await kookee.blog.getTags() // All translations by slug await kookee.blog.getTranslationsBySlug(slug) // All translations by ID await kookee.blog.getTranslationsById(id) // Add/remove reaction (fire, heart, rocket, eyes, mindblown) await kookee.blog.react(postId, params) ``` -------------------------------- ### Fetch and Render Blog Posts in Next.js Source: https://context7_llms This example shows how to fetch a list of blog posts using the Kookee SDK within a Next.js application and render them as a list of links. It assumes the Kookee SDK has been initialized in '@/lib/kookee'. ```typescript import { kookee } from '@/lib/kookee'; export default async function BlogPage() { const { data: posts } = await kookee.blog.list(); return ( ); } ``` -------------------------------- ### Blog Post Pagination Example (JavaScript) Source: https://context7_llms Illustrates how to paginate through blog posts. It shows fetching the first page with a specified limit and then checking for the existence of next and previous pages based on the current page and total pages. ```javascript const page1 = await kookee.blog.list({ page: 1, limit: 10 }); const hasNextPage = page1.page < page1.totalPages; const hasPrevPage = page1.page > 1; ``` -------------------------------- ### Accessing SDK Modules Source: https://context7_llms Once initialized, you can access various modules and their methods directly from the Kookee SDK instance. Examples include blog, changelog, pages, and more. ```APIDOC ## Accessing SDK Modules ### Description All modules and methods are available under the `KookeeSDK` global namespace after loading the script. You can interact with modules like `blog`, `changelog`, `pages`, `config`, `announcements`, and `feedback`. ### Method Method Invocation ### Endpoint N/A ### Parameters Refer to individual module documentation for specific method parameters. ### Request Example ```javascript // Accessing blog module const blogPosts = await kookee.blog.list(); // Accessing changelog module const changelogEntries = await kookee.changelog.list(); // Accessing help module const helpCategories = await kookee.help.categories(); // Accessing pages module const pagesList = await kookee.pages.list(); // Accessing config module const configValue = await kookee.config.getByKey('some_key'); // Accessing announcements module const announcementsList = await kookee.announcements.list(); // Accessing feedback module const feedbackList = await kookee.feedback.list(); ``` ### Response #### Success Response Results depend on the specific method called (e.g., array of blog posts, list of changelog entries, etc.). #### Response Example ```json // Example response for kookee.blog.list() { "data": [ { "id": "1", "title": "First Post", "contentHtml": "

Content...

" }, // ... more posts ] } ``` ``` -------------------------------- ### Initialize Kookee SDK Client via CDN Source: https://context7_llms Demonstrates how to include the Kookee SDK script and initialize the client with an API key. This is the first step for using the SDK in a web page. ```javascript ``` -------------------------------- ### GET /v1/announcements/:id Source: https://context7_llms Retrieves an announcement by its ID. ```APIDOC ## GET /v1/announcements/:id ### Description Gets announcement by ID. ### Method GET ### Endpoint /v1/announcements/:id ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the announcement. ### Request Example No request body. ### Response #### Success Response (200) - **(Announcement object)** - The announcement object. #### Response Example { /* Announcement object */ } ``` -------------------------------- ### GET /v1/announcements Source: https://context7_llms Retrieves a list of active announcements. ```APIDOC ## GET /v1/announcements ### Description Lists active announcements. ### Method GET ### Endpoint /v1/announcements ### Parameters #### Query Parameters - **page** (integer) - Optional - Page number for pagination. - **limit** (integer) - Optional - Number of items per page. - **type** (string) - Optional - Filter by type (info/warning/critical/promotion/maintenance/newFeature). - **locale** (string) - Optional - Localization. - **fallback** (boolean) - Optional - Fallback. - **excludeIds** (string) - Optional - Comma-separated list of IDs to exclude. - **orderBy** (string) - Optional - Order by (createdAt/publishedAt). - **order** (string) - Optional - Order (asc/desc). ### Request Example No request body. ### Response #### Success Response (200) - **data** (array) - Array of announcement objects. - **total** (integer) - Total number of announcements. - **page** (integer) - Current page number. - **limit** (integer) - Number of items per page. - **offset** (integer) - Offset for pagination. - **totalPages** (integer) - Total number of pages. #### Response Example { "data": [ { /* Announcement object */ } ], "total": 25, "page": 1, "limit": 10, "offset": 0, "totalPages": 3 } ``` -------------------------------- ### Kookee SDK Help Module Quick Reference Source: https://context7_llms A quick reference guide for the Help Center module of the Kookee SDK, outlining methods for listing articles, retrieving articles by slug or ID, searching, managing categories, and voting on usefulness. Assumes the SDK has been initialized. ```javascript // List articles (pagination, category, search, locale) await kookee.help.list(params?) // Get article by slug await kookee.help.getBySlug(slug, options?) // Get article by ID await kookee.help.getById(id) // List categories await kookee.help.categories(options?) // Search articles await kookee.help.search(params) // All translations by slug await kookee.help.getTranslationsBySlug(slug) // All translations by ID await kookee.help.getTranslationsById(articleId) // Vote yes/no on article usefulness await kookee.help.voteUsefulness(articleId, vote, previousVote?) ``` -------------------------------- ### GET /v1/changelog Source: https://context7_llms Retrieves a list of changelog entries. ```APIDOC ## GET /v1/changelog ### Description Lists entries. ### Method GET ### Endpoint /v1/changelog ### Parameters #### Query Parameters - **page** (integer) - Optional - Page number for pagination. - **limit** (integer) - Optional - Number of items per page. - **type** (string) - Optional - Filter by type (feature/fix/improvement/breaking/security/deprecated/other). - **search** (string) - Optional - Search query. - **locale** (string) - Optional - Localization. - **fallback** (boolean) - Optional - Fallback. - **orderBy** (string) - Optional - Order by (createdAt/publishedAt/version). - **order** (string) - Optional - Order (asc/desc). ### Request Example No request body. ### Response #### Success Response (200) - **data** (array) - Array of changelog entry objects. - **total** (integer) - Total number of entries. - **page** (integer) - Current page number. - **limit** (integer) - Number of items per page. - **offset** (integer) - Offset for pagination. - **totalPages** (integer) - Total number of pages. #### Response Example { "data": [ { /* Changelog entry object */ } ], "total": 25, "page": 1, "limit": 10, "offset": 0, "totalPages": 3 } ``` -------------------------------- ### Fetch Blog Posts in Node.js/Express with Kookee SDK Source: https://context7_llms This example demonstrates setting up an Express.js route to fetch blog posts using the Kookee SDK. It initializes the SDK and then uses it to retrieve and return posts as JSON. ```typescript import express from 'express'; import { Kookee } from '@kookee/sdk'; const app = express(); const kookee = new Kookee({ apiKey: process.env.KOOKEE_API_KEY! }); app.get('/api/posts', async (req, res) => { const response = await kookee.blog.list(); res.json(response); }); ``` -------------------------------- ### GET /v1/announcements/:id/translations Source: https://context7_llms Retrieves translations for an announcement by its ID. ```APIDOC ## GET /v1/announcements/:id/translations ### Description Gets translations by ID. ### Method GET ``` -------------------------------- ### GET /v1/changelog/by-id/:id Source: https://context7_llms Retrieves a changelog entry by its ID. ```APIDOC ## GET /v1/changelog/by-id/:id ### Description Gets entry by ID. ### Method GET ### Endpoint /v1/changelog/by-id/:id ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the changelog entry. ### Request Example No request body. ### Response #### Success Response (200) - **(Changelog entry object)** - The changelog entry object. #### Response Example { /* Changelog entry object */ } ``` -------------------------------- ### Kookee SDK Pagination and Filtering Source: https://context7_llms Shows examples of how to paginate, filter by tags, search, and combine these options when fetching blog posts using the Kookee SDK. Assumes the SDK has been initialized. ```javascript // Pagination const page2 = await kookee.blog.list({ page: 2, limit: 10 }); // Filter by tags const tutorials = await kookee.blog.list({ tags: ['tutorial'] }); // Search const results = await kookee.blog.list({ search: 'authentication' }); // Combine const filtered = await kookee.blog.list({ tags: ['tutorial'], search: 'react', page: 1, limit: 5, }); ``` -------------------------------- ### GET /v1/changelog/:slug Source: https://context7_llms Retrieves a changelog entry by its slug. ```APIDOC ## GET /v1/changelog/:slug ### Description Gets entry by slug. ### Method GET ### Endpoint /v1/changelog/:slug ### Parameters #### Path Parameters - **slug** (string) - Required - The slug of the changelog entry. ### Request Example No request body. ### Response #### Success Response (200) - **(Changelog entry object)** - The changelog entry object. #### Response Example { /* Changelog entry object */ } ``` -------------------------------- ### GET /v1/help/articles Source: https://context7_llms Retrieves a list of help center articles. ```APIDOC ## GET /v1/help/articles ### Description Lists articles. ### Method GET ### Endpoint /v1/help/articles ### Parameters #### Query Parameters - **page** (integer) - Optional - Page number for pagination. - **limit** (integer) - Optional - Number of items per page. - **category** (string) - Optional - Filter by category. - **search** (string) - Optional - Search query. - **locale** (string) - Optional - Localization. - **fallback** (boolean) - Optional - Fallback. ### Request Example No request body. ### Response #### Success Response (200) - **data** (array) - Array of article objects. - **total** (integer) - Total number of articles. - **page** (integer) - Current page number. - **limit** (integer) - Number of items per page. - **offset** (integer) - Offset for pagination. - **totalPages** (integer) - Total number of pages. #### Response Example { "data": [ { /* Article object */ } ], "total": 25, "page": 1, "limit": 10, "offset": 0, "totalPages": 3 } ``` -------------------------------- ### Access Kookee SDK Modules and Methods Source: https://context7_llms After initializing the Kookee SDK, you can access various modules and their methods to interact with Kookee services. This example shows calls to blog, changelog, help, pages, config, announcements, and feedback modules. ```javascript const kookee = new KookeeSDK.Kookee({ apiKey: 'your-api-key' }); // All modules availablekookee.blog.list();kookee.changelog.list();kookee.help.categories();kookee.pages.list();kookee.config.getByKey('key');kookee.announcements.list();kookee.feedback.list(); ``` -------------------------------- ### GET /v1/help/categories Source: https://context7_llms Retrieves a list of help center categories. ```APIDOC ## GET /v1/help/categories ### Description Lists categories. ### Method GET ### Endpoint /v1/help/categories ### Parameters No parameters. ### Request Example No request body. ### Response #### Success Response (200) - **(Category objects)** - Array of category objects. #### Response Example [ { /* Category object */ } ] ``` -------------------------------- ### Fetch Blog Posts using Kookee SDK Source: https://context7_llms Demonstrates how to fetch a list of blog posts using the Kookee SDK. The response includes pagination details and an array of blog post items. Assumes the SDK has been initialized. ```javascript import { Kookee } from '@kookee/sdk'; const kookee = new Kookee({ apiKey: process.env.KOOKEE_API_KEY! }); const response = await kookee.blog.list(); console.log(response.data); // BlogPostListItem[] ``` -------------------------------- ### List Paginated Help Center Articles (Kookee SDK) Source: https://context7_llms An example of listing help center articles with pagination and filtering by category using the Kookee SDK. It demonstrates fetching the first page with 10 articles from the 'getting-started' category. The `kookee.help.list()` function is utilized. ```javascript // List articles (paginated) const articles = await kookee.help.list({ page: 1, limit: 10, category: 'getting-started' }); ``` -------------------------------- ### GET /v1/changelog/by-id/:id/translations Source: https://context7_llms Retrieves translations for a changelog entry by its ID. ```APIDOC ## GET /v1/changelog/by-id/:id/translations ### Description Gets translations by ID. ### Method GET ### Endpoint /v1/changelog/by-id/:id/translations ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the changelog entry. ### Request Example No request body. ### Response #### Success Response (200) - **(Translation objects)** - Array of translation objects. #### Response Example [ { /* Translation object */ } ] ``` -------------------------------- ### GET /v1/changelog/:slug/translations Source: https://context7_llms Retrieves translations for a changelog entry by its slug. ```APIDOC ## GET /v1/changelog/:slug/translations ### Description Gets translations by slug. ### Method GET ### Endpoint /v1/changelog/:slug/translations ### Parameters #### Path Parameters - **slug** (string) - Required - The slug of the changelog entry. ### Request Example No request body. ### Response #### Success Response (200) - **(Translation objects)** - Array of translation objects. #### Response Example [ { /* Translation object */ } ] ``` -------------------------------- ### Initialize Kookee SDK with API Key Source: https://context7_llms This JavaScript code demonstrates how to initialize the Kookee SDK client by providing your unique API key. The SDK is accessed through the global KookeeSDK namespace. ```javascript const kookee = new KookeeSDK.Kookee({ apiKey: 'your-api-key' }); ``` -------------------------------- ### Kookee SDK Config Module Quick Reference Source: https://context7_llms A quick reference guide for the Config module of the Kookee SDK, showing how to list all configuration values or retrieve a single value by its key. Assumes the SDK has been initialized. ```javascript // List config values (optionally filter by keys) await kookee.config.list(params?) // Get single config value await kookee.config.getByKey(key) ``` -------------------------------- ### GET /v1/help/articles/by-id/:id Source: https://context7_llms Retrieves a help center article by its ID. ```APIDOC ## GET /v1/help/articles/by-id/:id ### Description Gets article by ID. ### Method GET ### Endpoint /v1/help/articles/by-id/:id ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the article. ### Request Example No request body. ### Response #### Success Response (200) - **(Article object)** - The article object. #### Response Example { /* Article object */ } ``` -------------------------------- ### GET /v1/help/articles/:slug Source: https://context7_llms Retrieves a help center article by its slug. ```APIDOC ## GET /v1/help/articles/:slug ### Description Gets article by slug. ### Method GET ### Endpoint /v1/help/articles/:slug ### Parameters #### Path Parameters - **slug** (string) - Required - The slug of the article. ### Request Example No request body. ### Response #### Success Response (200) - **(Article object)** - The article object. #### Response Example { /* Article object */ } ``` -------------------------------- ### Initialize Kookee SDK Source: https://context7_llms Initializes the Kookee SDK with an API key. This is the first step before making any content requests. It assumes the API key is stored in an environment variable. ```javascript import { Kookee } from '@kookee/sdk'; const kookee = new Kookee({ apiKey: process.env.KOOKEE_API_KEY, }); ``` -------------------------------- ### GET /v1/help/search Source: https://context7_llms Searches help center articles based on a query. ```APIDOC ## GET /v1/help/search ### Description Searches articles. ### Method GET ### Endpoint /v1/help/search ### Parameters #### Query Parameters - **query** (string) - Required - Search query. - **limit** (integer) - Optional - Number of results per page. - **locale** (string) - Optional - Localization. - **fallback** (boolean) - Optional - Fallback. ### Request Example No request body. ### Response #### Success Response (200) - **(Article objects)** - Array of article objects matching the search query. #### Response Example [ { /* Article object */ } ] ``` -------------------------------- ### Search Help Center Articles (Kookee SDK) Source: https://context7_llms Demonstrates how to perform a semantic search for help center articles using the Kookee SDK. This example searches for articles related to 'billing' and limits the results to 5. The `kookee.help.search()` function is employed. ```javascript // Search articles const results = await kookee.help.search({ query: 'billing', limit: 5 }); ``` -------------------------------- ### GET /v1/help/articles/by-id/:id/translations Source: https://context7_llms Retrieves translations for a help center article by its ID. ```APIDOC ## GET /v1/help/articles/by-id/:id/translations ### Description Gets translations by ID. ### Method GET ### Endpoint /v1/help/articles/by-id/:id/translations ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the article. ### Request Example No request body. ### Response #### Success Response (200) - **(Translation objects)** - Array of translation objects. #### Response Example [ { /* Translation object */ } ] ``` -------------------------------- ### Kookee SDK Initialization Source: https://context7_llms Initialize the Kookee SDK by creating a new instance of the Kookee class, passing your API key as a constructor option. ```APIDOC ## Kookee SDK Initialization ### Description Initialize the Kookee SDK by creating a new instance of the `KookeeSDK.Kookee` class. The `apiKey` is a required option. ### Method Constructor ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Constructor Options - **apiKey** (string) - Required - Your unique API key for authentication. ### Request Example ```javascript const kookee = new KookeeSDK.Kookee({ apiKey: 'your-api-key' }); ``` ### Response #### Success Response Kookee SDK instance. #### Response Example ```javascript // kookee instance created successfully ``` ``` -------------------------------- ### GET /v1/help/articles/:slug/translations Source: https://context7_llms Retrieves translations for a help center article by its slug. ```APIDOC ## GET /v1/help/articles/:slug/translations ### Description Gets translations by slug. ### Method GET ### Endpoint /v1/help/articles/:slug/translations ### Parameters #### Path Parameters - **slug** (string) - Required - The slug of the article. ### Request Example No request body. ### Response #### Success Response (200) - **(Translation objects)** - Array of translation objects. #### Response Example [ { /* Translation object */ } ] ``` -------------------------------- ### React Home Page for Help Center Source: https://context7_llms Renders the main page of the help center, displaying categories and a search bar. It uses TanStack Query to fetch categories and search results. The UI dynamically shows search results or category grids based on user input. ```typescript 'use client'; import { useQuery } from '@tanstack/react-query'; import { useState } from 'react'; import { kookee } from '@/lib/kookee'; import Link from 'next/link'; export default function HelpCenterHome() { const [search, setSearch] = useState(''); const { data: categories, isLoading: categoriesLoading } = useQuery({ queryKey: ['help-categories'], queryFn: () => kookee.help.categories(), }); const { data: searchResults, isLoading: searchLoading } = useQuery({ queryKey: ['help-search', search], queryFn: () => kookee.help.search({ query: search }), enabled: search.length >= 2, }); const isSearching = search.length >= 2; return (

Help Center

Find answers to your questions

setSearch(e.target.value)} className="mt-6 w-full rounded-lg border px-4 py-3 text-lg" /> {isSearching && (

Search Results

{searchLoading &&

Searching...

} {searchResults?.length === 0 && (

No articles found

)} {searchResults && searchResults.length > 0 && (
    {searchResults.map((article) => (
  • {article.title}

    {article.category.name}

  • ))}
)}
)} {!isSearching && (

Browse by Category

{categoriesLoading &&

Loading...

} {categories && (
{categories.map((category) => ( {category.icon && {category.icon}}

{category.name}

{category.description && (

{category.description}

)}

{category.articleCount} articles

))}
)}
)}
); } ``` -------------------------------- ### Get Single Changelog Entry Source: https://context7_llms Retrieves a single changelog entry by its slug or ID. ```APIDOC ## GET /changelog/{slug_or_id} ### Description Get a single changelog entry by its slug or ID. ### Method GET ### Endpoint /changelog/{slug_or_id} ### Parameters #### Path Parameters - **slug_or_id** (string) - Required - The slug or ID of the changelog entry #### Query Parameters - **locale** (string) - Optional - Content locale (e.g. de) - **fallback** (boolean) - Optional - Default: true - Fall back to default locale if translation missing ### Request Example ```javascript // Get by slug const entry = await kookee.changelog.getBySlug('v2-release'); // Get by ID const entry = await kookee.changelog.getById('entry_abc123'); // With locale and fallback const entry = await kookee.changelog.getBySlug('v2-release', { locale: 'de', fallback: true, }); ``` ### Response #### Success Response (200) - **id** (string) - **slug** (string) - **title** (string) - **type** (ChangelogType) - **version** (string | null) - **contentHtml** (string) - **publishedAt** (string | null) - **createdAt** (string) - **locale** (string) - **translationGroupId** (string) - **metadata** (Record | null) - **author** (object) - **name** (string) - **reactions** (Record) - **link** (string | null) - **updatedAt** (string) #### Response Example ```json { "id": "entry_abc123", "slug": "v2-release", "title": "Kookee v2 Release", "type": "feature", "version": "2.0.0", "contentHtml": "

New features and improvements in v2...

", "publishedAt": "2023-10-27T10:00:00Z", "createdAt": "2023-10-26T09:00:00Z", "locale": "en", "translationGroupId": "group_xyz", "metadata": null, "author": {"name": "Kookee Team"}, "reactions": {"fire": 10, "heart": 5}, "link": "https://kookee.io/changelog/v2-release", "updatedAt": "2023-10-27T11:00:00Z" } ``` ``` -------------------------------- ### Get All Translations by ID Source: https://context7_llms Retrieves all available translations for a blog post identified by its ID. ```APIDOC ## GET /blog/translations/id/{id} ### Description Fetches all translations for a given blog post, identified by its unique ID. Returns a map where keys are locale codes and values are the corresponding blog post objects. ### Method GET ### Endpoint `/blog/translations/id/{id}` ### Parameters #### Path Parameters - **id** (string) - Required - The unique UUID of the blog post for which to fetch translations. ### Request Example ```javascript await kookee.blog.getTranslationsById('550e8400-e29b-41d4-a716-446655440000'); ``` ### Response #### Success Response (200) - **Record** - An object where keys are locale codes (e.g., 'en', 'de') and values are the full BlogPost objects for that locale. #### Response Example ```json { "en": { "id": "550e8400-e29b-41d4-a716-446655440000", "slug": "example-post-slug-en", "title": "Example Post Title (EN)", "excerptHtml": "

Excerpt...

", "contentHtml": "

Full content in English...

", "coverImageUrl": null, "status": "published", "publishedAt": "2023-10-27T10:00:00Z", "metaTitle": "Example Post Title (EN)", "metaDescription": "Description in English.", "createdAt": "2023-10-26T09:00:00Z", "updatedAt": "2023-10-26T09:00:00Z", "views": 1100, "author": {"name": "Jane Smith"}, "tags": [], "locale": "en", "translationGroupId": "group-xyz", "reactions": {}, "metadata": null }, "fr": { "id": "post-uuid-fr", "slug": "exemple-article-fr", "title": "Titre d'Article Exemple (FR)", "excerptHtml": "

Extrait...

", "contentHtml": "

Contenu complet en français...

", "coverImageUrl": null, "status": "published", "publishedAt": "2023-10-27T10:00:00Z", "metaTitle": "Titre d'Article Exemple (FR)", "metaDescription": "Description en français.", "createdAt": "2023-10-26T09:00:00Z", "updatedAt": "2023-10-26T09:00:00Z", "views": 250, "author": {"name": "Jane Smith"}, "tags": [], "locale": "fr", "translationGroupId": "group-xyz", "reactions": {}, "metadata": null } } ``` ### Error Handling - **404** - Post not found. ``` -------------------------------- ### Implement Blog Post Pagination in Vue Source: https://context7_llms Demonstrates how to implement pagination for fetching blog posts in Vue. It uses `ref` for the current page and `watch` to trigger fetching new posts when the page number changes. Includes navigation buttons. ```vue ```