{"id":41235948,"url":"https://github.com/inkeep/inkeep-analytics-typescript","last_synced_at":"2026-01-23T01:03:37.432Z","repository":{"id":276052123,"uuid":"928045270","full_name":"inkeep/inkeep-analytics-typescript","owner":"inkeep","description":null,"archived":false,"fork":false,"pushed_at":"2026-01-20T04:36:07.000Z","size":2067,"stargazers_count":1,"open_issues_count":6,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-20T11:48:41.386Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/inkeep.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-06T00:58:20.000Z","updated_at":"2025-12-15T20:36:18.000Z","dependencies_parsed_at":"2025-03-25T05:22:02.311Z","dependency_job_id":"f2505973-91d1-4d9a-bc7c-4c2e79a59032","html_url":"https://github.com/inkeep/inkeep-analytics-typescript","commit_stats":null,"previous_names":["inkeep/inkeep-analytics-typescript"],"tags_count":41,"template":false,"template_full_name":null,"purl":"pkg:github/inkeep/inkeep-analytics-typescript","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inkeep%2Finkeep-analytics-typescript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inkeep%2Finkeep-analytics-typescript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inkeep%2Finkeep-analytics-typescript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inkeep%2Finkeep-analytics-typescript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/inkeep","download_url":"https://codeload.github.com/inkeep/inkeep-analytics-typescript/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inkeep%2Finkeep-analytics-typescript/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28676491,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T01:00:35.747Z","status":"ssl_error","status_checked_at":"2026-01-23T01:00:19.529Z","response_time":144,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-23T01:03:37.335Z","updated_at":"2026-01-23T01:03:37.412Z","avatar_url":"https://github.com/inkeep.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# inkeep-analytics-typescript\n\nDeveloper-friendly \u0026 type-safe Typescript SDK specifically catered to leverage *inkeep-analytics-typescript* API.\n\n\u003cdiv align=\"left\"\u003e\n    \u003ca href=\"https://www.speakeasy.com/?utm_source=inkeep-analytics-typescript\u0026utm_campaign=typescript\"\u003e\u003cimg src=\"https://custom-icon-badges.demolab.com/badge/-Built%20By%20Speakeasy-212015?style=for-the-badge\u0026logoColor=FBE331\u0026logo=speakeasy\u0026labelColor=545454\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://opensource.org/licenses/MIT\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/License-MIT-blue.svg\" style=\"width: 100px; height: 28px;\" /\u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n\n\n\u003cbr /\u003e\u003cbr /\u003e\n\u003e [!IMPORTANT]\n\u003e This SDK is not yet ready for production use. To complete setup please follow the steps outlined in your [workspace](https://app.speakeasy.com/org/inkeep/inkeep). Delete this section before \u003e publishing to a package manager.\n\n\u003c!-- Start Summary [summary] --\u003e\n## Summary\n\nInkeep Analytics API: The Inkeep Analytics API provides endpoints for managing conversations, feedback, events, and queries. For details on authentication, see [authentication documentation](/analytics-api/authentication)\n\u003c!-- End Summary [summary] --\u003e\n\n\u003c!-- Start Table of Contents [toc] --\u003e\n## Table of Contents\n\u003c!-- $toc-max-depth=2 --\u003e\n* [inkeep-analytics-typescript](#inkeep-analytics-typescript)\n  * [SDK Installation](#sdk-installation)\n  * [Requirements](#requirements)\n  * [SDK Example Usage](#sdk-example-usage)\n  * [Authentication](#authentication)\n  * [Available Resources and Operations](#available-resources-and-operations)\n  * [Standalone functions](#standalone-functions)\n  * [React hooks with TanStack Query](#react-hooks-with-tanstack-query)\n  * [Retries](#retries)\n  * [Error Handling](#error-handling)\n  * [Server Selection](#server-selection)\n  * [Custom HTTP Client](#custom-http-client)\n  * [Debugging](#debugging)\n* [Development](#development)\n  * [Maturity](#maturity)\n  * [Contributions](#contributions)\n\n\u003c!-- End Table of Contents [toc] --\u003e\n\n\u003c!-- Start SDK Installation [installation] --\u003e\n## SDK Installation\n\nThe SDK can be installed with either [npm](https://www.npmjs.com/), [pnpm](https://pnpm.io/), [bun](https://bun.sh/) or [yarn](https://classic.yarnpkg.com/en/) package managers.\n\n### NPM\n\n```bash\nnpm add @inkeep/inkeep-analytics\n# Install optional peer dependencies if you plan to use React hooks\nnpm add @tanstack/react-query react react-dom\n```\n\n### PNPM\n\n```bash\npnpm add @inkeep/inkeep-analytics\n# Install optional peer dependencies if you plan to use React hooks\npnpm add @tanstack/react-query react react-dom\n```\n\n### Bun\n\n```bash\nbun add @inkeep/inkeep-analytics\n# Install optional peer dependencies if you plan to use React hooks\nbun add @tanstack/react-query react react-dom\n```\n\n### Yarn\n\n```bash\nyarn add @inkeep/inkeep-analytics\n# Install optional peer dependencies if you plan to use React hooks\nyarn add @tanstack/react-query react react-dom\n```\n\n\u003e [!NOTE]\n\u003e This package is published with CommonJS and ES Modules (ESM) support.\n\n\n### Model Context Protocol (MCP) Server\n\nThis SDK is also an installable MCP server where the various SDK methods are\nexposed as tools that can be invoked by AI applications.\n\n\u003e Node.js v20 or greater is required to run the MCP server from npm.\n\n\u003cdetails\u003e\n\u003csummary\u003eClaude installation steps\u003c/summary\u003e\n\nAdd the following server definition to your `claude_desktop_config.json` file:\n\n```json\n{\n  \"mcpServers\": {\n    \"InkeepAnalytics\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"-y\", \"--package\", \"@inkeep/inkeep-analytics\",\n        \"--\",\n        \"mcp\", \"start\",\n        \"--api-integration-key\", \"...\"\n      ]\n    }\n  }\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eCursor installation steps\u003c/summary\u003e\n\nCreate a `.cursor/mcp.json` file in your project root with the following content:\n\n```json\n{\n  \"mcpServers\": {\n    \"InkeepAnalytics\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"-y\", \"--package\", \"@inkeep/inkeep-analytics\",\n        \"--\",\n        \"mcp\", \"start\",\n        \"--api-integration-key\", \"...\"\n      ]\n    }\n  }\n}\n```\n\n\u003c/details\u003e\n\nYou can also run MCP servers as a standalone binary with no additional dependencies. You must pull these binaries from available Github releases:\n\n```bash\ncurl -L -o mcp-server \\\n    https://github.com/{org}/{repo}/releases/download/{tag}/mcp-server-bun-darwin-arm64 \u0026\u0026 \\\nchmod +x mcp-server\n```\n\nIf the repo is a private repo you must add your Github PAT to download a release `-H \"Authorization: Bearer {GITHUB_PAT}\"`.\n\n\n```json\n{\n  \"mcpServers\": {\n    \"Todos\": {\n      \"command\": \"./DOWNLOAD/PATH/mcp-server\",\n      \"args\": [\n        \"start\"\n      ]\n    }\n  }\n}\n```\n\nFor a full list of server arguments, run:\n\n```sh\nnpx -y --package @inkeep/inkeep-analytics -- mcp start --help\n```\n\u003c!-- End SDK Installation [installation] --\u003e\n\n\u003c!-- Start Requirements [requirements] --\u003e\n## Requirements\n\nFor supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md).\n\u003c!-- End Requirements [requirements] --\u003e\n\n\u003c!-- Start SDK Example Usage [usage] --\u003e\n## SDK Example Usage\n\n### Example\n\n```typescript\nimport { InkeepAnalytics } from \"@inkeep/inkeep-analytics\";\n\nconst inkeepAnalytics = new InkeepAnalytics({\n  apiIntegrationKey: process.env[\"INKEEPANALYTICS_API_INTEGRATION_KEY\"] ?? \"\",\n});\n\nasync function run() {\n  const result = await inkeepAnalytics.topSearchQueries({});\n\n  console.log(result);\n}\n\nrun();\n\n```\n\u003c!-- End SDK Example Usage [usage] --\u003e\n\n\u003c!-- Start Authentication [security] --\u003e\n## Authentication\n\n### Per-Client Security Schemes\n\nThis SDK supports the following security scheme globally:\n\n| Name                | Type | Scheme      | Environment Variable                  |\n| ------------------- | ---- | ----------- | ------------------------------------- |\n| `apiIntegrationKey` | http | HTTP Bearer | `INKEEPANALYTICS_API_INTEGRATION_KEY` |\n\nTo authenticate with the API the `apiIntegrationKey` parameter must be set when initializing the SDK client instance. For example:\n```typescript\nimport { InkeepAnalytics } from \"@inkeep/inkeep-analytics\";\n\nconst inkeepAnalytics = new InkeepAnalytics({\n  apiIntegrationKey: process.env[\"INKEEPANALYTICS_API_INTEGRATION_KEY\"] ?? \"\",\n});\n\nasync function run() {\n  const result = await inkeepAnalytics.topSearchQueries({});\n\n  console.log(result);\n}\n\nrun();\n\n```\n\n### Per-Operation Security Schemes\n\nSome operations in this SDK require the security scheme to be specified at the request level. For example:\n```typescript\nimport { InkeepAnalytics } from \"@inkeep/inkeep-analytics\";\n\nconst inkeepAnalytics = new InkeepAnalytics();\n\nasync function run() {\n  const result = await inkeepAnalytics.conversations.log({}, {\n    type: \"support_copilot\",\n    messages: [\n      {\n        role: \"\u003cvalue\u003e\",\n        userProperties: {\n          identificationType: \"COOKIED\",\n        },\n      },\n    ],\n  });\n\n  console.log(result);\n}\n\nrun();\n\n```\n\u003c!-- End Authentication [security] --\u003e\n\n\u003c!-- Start Available Resources and Operations [operations] --\u003e\n## Available Resources and Operations\n\n\u003cdetails open\u003e\n\u003csummary\u003eAvailable methods\u003c/summary\u003e\n\n### [InkeepAnalytics SDK](docs/sdks/inkeepanalytics/README.md)\n\n* [topSearchQueries](docs/sdks/inkeepanalytics/README.md#topsearchqueries) - Top Search Queries\n* [weeklySearchUsers](docs/sdks/inkeepanalytics/README.md#weeklysearchusers) - Weekly Search Users\n\n### [Conversation](docs/sdks/conversation/README.md)\n\n* [getConversationByExternalId](docs/sdks/conversation/README.md#getconversationbyexternalid) - Get Conversation by External ID\n\n### [Conversations](docs/sdks/conversations/README.md)\n\n* [log](docs/sdks/conversations/README.md#log) - Log Conversation\n* [list](docs/sdks/conversations/README.md#list) - Get All Conversations\n* [get](docs/sdks/conversations/README.md#get) - Get Conversation\n* [delete](docs/sdks/conversations/README.md#delete) - Delete Conversation\n\n### [Events](docs/sdks/events/README.md)\n\n* [log](docs/sdks/events/README.md#log) - Log Event\n\n### [Feedback](docs/sdks/feedback/README.md)\n\n* [submit](docs/sdks/feedback/README.md#submit) - Log Feedback\n* [list](docs/sdks/feedback/README.md#list) - Get All Feedback\n* [getFeedbackById](docs/sdks/feedback/README.md#getfeedbackbyid) - Get Feedback by ID\n* [deleteFeedbackById](docs/sdks/feedback/README.md#deletefeedbackbyid) - Delete Feedback by ID\n\n### [Query](docs/sdks/query/README.md)\n\n* [conversations](docs/sdks/query/README.md#conversations) - Query Conversations\n* [queryEvents](docs/sdks/query/README.md#queryevents) - Query Events\n* [queryFeedback](docs/sdks/query/README.md#queryfeedback) - Query Feedback\n* [querySemanticThreads](docs/sdks/query/README.md#querysemanticthreads) - Query Semantic Threads\n* [exportSemanticThreadsQueryResults](docs/sdks/query/README.md#exportsemanticthreadsqueryresults) - Export Semantic Threads Query Results\n* [exportConversationsQueryResults](docs/sdks/query/README.md#exportconversationsqueryresults) - Export Conversations Query Results\n* [exportEventsQueryResults](docs/sdks/query/README.md#exporteventsqueryresults) - Export Events Query Results\n* [exportFeedbackQueryResults](docs/sdks/query/README.md#exportfeedbackqueryresults) - Export Feedback Query Results\n* [queryPropertyKeys](docs/sdks/query/README.md#querypropertykeys) - Query Property Keys\n* [queryPropertyValues](docs/sdks/query/README.md#querypropertyvalues) - Query Property Values\n\n\u003c/details\u003e\n\u003c!-- End Available Resources and Operations [operations] --\u003e\n\n\u003c!-- Start Standalone functions [standalone-funcs] --\u003e\n## Standalone functions\n\nAll the methods listed above are available as standalone functions. These\nfunctions are ideal for use in applications running in the browser, serverless\nruntimes or other environments where application bundle size is a primary\nconcern. When using a bundler to build your application, all unused\nfunctionality will be either excluded from the final bundle or tree-shaken away.\n\nTo read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAvailable standalone functions\u003c/summary\u003e\n\n- [`conversationGetConversationByExternalId`](docs/sdks/conversation/README.md#getconversationbyexternalid) - Get Conversation by External ID\n- [`conversationsDelete`](docs/sdks/conversations/README.md#delete) - Delete Conversation\n- [`conversationsGet`](docs/sdks/conversations/README.md#get) - Get Conversation\n- [`conversationsList`](docs/sdks/conversations/README.md#list) - Get All Conversations\n- [`conversationsLog`](docs/sdks/conversations/README.md#log) - Log Conversation\n- [`eventsLog`](docs/sdks/events/README.md#log) - Log Event\n- [`feedbackDeleteFeedbackById`](docs/sdks/feedback/README.md#deletefeedbackbyid) - Delete Feedback by ID\n- [`feedbackGetFeedbackById`](docs/sdks/feedback/README.md#getfeedbackbyid) - Get Feedback by ID\n- [`feedbackList`](docs/sdks/feedback/README.md#list) - Get All Feedback\n- [`feedbackSubmit`](docs/sdks/feedback/README.md#submit) - Log Feedback\n- [`queryConversations`](docs/sdks/query/README.md#conversations) - Query Conversations\n- [`queryExportConversationsQueryResults`](docs/sdks/query/README.md#exportconversationsqueryresults) - Export Conversations Query Results\n- [`queryExportEventsQueryResults`](docs/sdks/query/README.md#exporteventsqueryresults) - Export Events Query Results\n- [`queryExportFeedbackQueryResults`](docs/sdks/query/README.md#exportfeedbackqueryresults) - Export Feedback Query Results\n- [`queryExportSemanticThreadsQueryResults`](docs/sdks/query/README.md#exportsemanticthreadsqueryresults) - Export Semantic Threads Query Results\n- [`queryQueryEvents`](docs/sdks/query/README.md#queryevents) - Query Events\n- [`queryQueryFeedback`](docs/sdks/query/README.md#queryfeedback) - Query Feedback\n- [`queryQueryPropertyKeys`](docs/sdks/query/README.md#querypropertykeys) - Query Property Keys\n- [`queryQueryPropertyValues`](docs/sdks/query/README.md#querypropertyvalues) - Query Property Values\n- [`queryQuerySemanticThreads`](docs/sdks/query/README.md#querysemanticthreads) - Query Semantic Threads\n- [`topSearchQueries`](docs/sdks/inkeepanalytics/README.md#topsearchqueries) - Top Search Queries\n- [`weeklySearchUsers`](docs/sdks/inkeepanalytics/README.md#weeklysearchusers) - Weekly Search Users\n\n\u003c/details\u003e\n\u003c!-- End Standalone functions [standalone-funcs] --\u003e\n\n\u003c!-- Start React hooks with TanStack Query [react-query] --\u003e\n## React hooks with TanStack Query\n\nReact hooks built on [TanStack Query][tanstack-query] are included in this SDK.\nThese hooks and the utility functions provided alongside them can be used to\nbuild rich applications that pull data from the API using one of the most\npopular asynchronous state management library.\n\n[tanstack-query]: https://tanstack.com/query/v5/docs/framework/react/overview\n\nTo learn about this feature and how to get started, check\n[REACT_QUERY.md](./REACT_QUERY.md).\n\n\u003e [!WARNING]\n\u003e\n\u003e This feature is currently in **preview** and is subject to breaking changes\n\u003e within the current major version of the SDK as we gather user feedback on it.\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAvailable React hooks\u003c/summary\u003e\n\n- [`useConversationGetConversationByExternalId`](docs/sdks/conversation/README.md#getconversationbyexternalid) - Get Conversation by External ID\n- [`useConversationsDeleteMutation`](docs/sdks/conversations/README.md#delete) - Delete Conversation\n- [`useConversationsGet`](docs/sdks/conversations/README.md#get) - Get Conversation\n- [`useConversationsList`](docs/sdks/conversations/README.md#list) - Get All Conversations\n- [`useConversationsLogMutation`](docs/sdks/conversations/README.md#log) - Log Conversation\n- [`useEventsLogMutation`](docs/sdks/events/README.md#log) - Log Event\n- [`useFeedbackDeleteFeedbackByIdMutation`](docs/sdks/feedback/README.md#deletefeedbackbyid) - Delete Feedback by ID\n- [`useFeedbackGetFeedbackById`](docs/sdks/feedback/README.md#getfeedbackbyid) - Get Feedback by ID\n- [`useFeedbackList`](docs/sdks/feedback/README.md#list) - Get All Feedback\n- [`useFeedbackSubmitMutation`](docs/sdks/feedback/README.md#submit) - Log Feedback\n- [`useQueryConversationsMutation`](docs/sdks/query/README.md#conversations) - Query Conversations\n- [`useQueryExportConversationsQueryResultsMutation`](docs/sdks/query/README.md#exportconversationsqueryresults) - Export Conversations Query Results\n- [`useQueryExportEventsQueryResultsMutation`](docs/sdks/query/README.md#exporteventsqueryresults) - Export Events Query Results\n- [`useQueryExportFeedbackQueryResultsMutation`](docs/sdks/query/README.md#exportfeedbackqueryresults) - Export Feedback Query Results\n- [`useQueryExportSemanticThreadsQueryResultsMutation`](docs/sdks/query/README.md#exportsemanticthreadsqueryresults) - Export Semantic Threads Query Results\n- [`useQueryQueryEventsMutation`](docs/sdks/query/README.md#queryevents) - Query Events\n- [`useQueryQueryFeedbackMutation`](docs/sdks/query/README.md#queryfeedback) - Query Feedback\n- [`useQueryQueryPropertyKeysMutation`](docs/sdks/query/README.md#querypropertykeys) - Query Property Keys\n- [`useQueryQueryPropertyValuesMutation`](docs/sdks/query/README.md#querypropertyvalues) - Query Property Values\n- [`useQueryQuerySemanticThreadsMutation`](docs/sdks/query/README.md#querysemanticthreads) - Query Semantic Threads\n- [`useTopSearchQueries`](docs/sdks/inkeepanalytics/README.md#topsearchqueries) - Top Search Queries\n- [`useWeeklySearchUsers`](docs/sdks/inkeepanalytics/README.md#weeklysearchusers) - Weekly Search Users\n\n\u003c/details\u003e\n\u003c!-- End React hooks with TanStack Query [react-query] --\u003e\n\n\u003c!-- Start Retries [retries] --\u003e\n## Retries\n\nSome of the endpoints in this SDK support retries.  If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API.  However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.\n\nTo change the default retry strategy for a single API call, simply provide a retryConfig object to the call:\n```typescript\nimport { InkeepAnalytics } from \"@inkeep/inkeep-analytics\";\n\nconst inkeepAnalytics = new InkeepAnalytics({\n  apiIntegrationKey: process.env[\"INKEEPANALYTICS_API_INTEGRATION_KEY\"] ?? \"\",\n});\n\nasync function run() {\n  const result = await inkeepAnalytics.topSearchQueries({}, {\n    retries: {\n      strategy: \"backoff\",\n      backoff: {\n        initialInterval: 1,\n        maxInterval: 50,\n        exponent: 1.1,\n        maxElapsedTime: 100,\n      },\n      retryConnectionErrors: false,\n    },\n  });\n\n  console.log(result);\n}\n\nrun();\n\n```\n\nIf you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization:\n```typescript\nimport { InkeepAnalytics } from \"@inkeep/inkeep-analytics\";\n\nconst inkeepAnalytics = new InkeepAnalytics({\n  retryConfig: {\n    strategy: \"backoff\",\n    backoff: {\n      initialInterval: 1,\n      maxInterval: 50,\n      exponent: 1.1,\n      maxElapsedTime: 100,\n    },\n    retryConnectionErrors: false,\n  },\n  apiIntegrationKey: process.env[\"INKEEPANALYTICS_API_INTEGRATION_KEY\"] ?? \"\",\n});\n\nasync function run() {\n  const result = await inkeepAnalytics.topSearchQueries({});\n\n  console.log(result);\n}\n\nrun();\n\n```\n\u003c!-- End Retries [retries] --\u003e\n\n\u003c!-- Start Error Handling [errors] --\u003e\n## Error Handling\n\n[`InkeepAnalyticsError`](./src/models/errors/inkeepanalyticserror.ts) is the base class for all HTTP error responses. It has the following properties:\n\n| Property            | Type       | Description                                                                             |\n| ------------------- | ---------- | --------------------------------------------------------------------------------------- |\n| `error.message`     | `string`   | Error message                                                                           |\n| `error.statusCode`  | `number`   | HTTP response status code eg `404`                                                      |\n| `error.headers`     | `Headers`  | HTTP response headers                                                                   |\n| `error.body`        | `string`   | HTTP body. Can be empty string if no body is returned.                                  |\n| `error.rawResponse` | `Response` | Raw HTTP response                                                                       |\n| `error.data$`       |            | Optional. Some errors may contain structured data. [See Error Classes](#error-classes). |\n\n### Example\n```typescript\nimport { InkeepAnalytics } from \"@inkeep/inkeep-analytics\";\nimport * as errors from \"@inkeep/inkeep-analytics/models/errors\";\n\nconst inkeepAnalytics = new InkeepAnalytics({\n  apiIntegrationKey: process.env[\"INKEEPANALYTICS_API_INTEGRATION_KEY\"] ?? \"\",\n});\n\nasync function run() {\n  try {\n    const result = await inkeepAnalytics.topSearchQueries({});\n\n    console.log(result);\n  } catch (error) {\n    // The base class for HTTP error responses\n    if (error instanceof errors.InkeepAnalyticsError) {\n      console.log(error.message);\n      console.log(error.statusCode);\n      console.log(error.body);\n      console.log(error.headers);\n\n      // Depending on the method different errors may be thrown\n      if (error instanceof errors.BadRequest) {\n        console.log(error.data$.title); // string\n        console.log(error.data$.status); // number\n        console.log(error.data$.detail); // string\n        console.log(error.data$.instance); // string\n        console.log(error.data$.requestId); // string\n      }\n    }\n  }\n}\n\nrun();\n\n```\n\n### Error Classes\n**Primary errors:**\n* [`InkeepAnalyticsError`](./src/models/errors/inkeepanalyticserror.ts): The base class for HTTP error responses.\n  * [`BadRequest`](./src/models/errors/badrequest.ts): Bad Request. Status code `400`.\n  * [`Unauthorized`](./src/models/errors/unauthorized.ts): Unauthorized. Status code `401`.\n  * [`Forbidden`](./src/models/errors/forbidden.ts): Forbidden. Status code `403`.\n  * [`UnprocessableEntity`](./src/models/errors/unprocessableentity.ts): Unprocessable Entity. Status code `422`.\n  * [`InternalServerError`](./src/models/errors/internalservererror.ts): Internal Server Error. Status code `500`.\n\n\u003cdetails\u003e\u003csummary\u003eLess common errors (7)\u003c/summary\u003e\n\n\u003cbr /\u003e\n\n**Network errors:**\n* [`ConnectionError`](./src/models/errors/httpclienterrors.ts): HTTP client was unable to make a request to a server.\n* [`RequestTimeoutError`](./src/models/errors/httpclienterrors.ts): HTTP request timed out due to an AbortSignal signal.\n* [`RequestAbortedError`](./src/models/errors/httpclienterrors.ts): HTTP request was aborted by the client.\n* [`InvalidRequestError`](./src/models/errors/httpclienterrors.ts): Any input used to create a request is invalid.\n* [`UnexpectedClientError`](./src/models/errors/httpclienterrors.ts): Unrecognised or unexpected error.\n\n\n**Inherit from [`InkeepAnalyticsError`](./src/models/errors/inkeepanalyticserror.ts)**:\n* [`NotFound`](./src/models/errors/notfound.ts): Not Found. Status code `404`. Applicable to 7 of 22 methods.*\n* [`ResponseValidationError`](./src/models/errors/responsevalidationerror.ts): Type mismatch between the data returned from the server and the structure expected by the SDK. See `error.rawValue` for the raw value and `error.pretty()` for a nicely formatted multi-line string.\n\n\u003c/details\u003e\n\n\\* Check [the method documentation](#available-resources-and-operations) to see if the error is applicable.\n\u003c!-- End Error Handling [errors] --\u003e\n\n\u003c!-- Start Server Selection [server] --\u003e\n## Server Selection\n\n### Override Server URL Per-Client\n\nThe default server can be overridden globally by passing a URL to the `serverURL: string` optional parameter when initializing the SDK client instance. For example:\n```typescript\nimport { InkeepAnalytics } from \"@inkeep/inkeep-analytics\";\n\nconst inkeepAnalytics = new InkeepAnalytics({\n  serverURL: \"https://api.analytics.inkeep.com\",\n  apiIntegrationKey: process.env[\"INKEEPANALYTICS_API_INTEGRATION_KEY\"] ?? \"\",\n});\n\nasync function run() {\n  const result = await inkeepAnalytics.topSearchQueries({});\n\n  console.log(result);\n}\n\nrun();\n\n```\n\u003c!-- End Server Selection [server] --\u003e\n\n\u003c!-- Start Custom HTTP Client [http-client] --\u003e\n## Custom HTTP Client\n\nThe TypeScript SDK makes API calls using an `HTTPClient` that wraps the native\n[Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API). This\nclient is a thin wrapper around `fetch` and provides the ability to attach hooks\naround the request lifecycle that can be used to modify the request or handle\nerrors and response.\n\nThe `HTTPClient` constructor takes an optional `fetcher` argument that can be\nused to integrate a third-party HTTP client or when writing tests to mock out\nthe HTTP client and feed in fixtures.\n\nThe following example shows how to use the `\"beforeRequest\"` hook to to add a\ncustom header and a timeout to requests and how to use the `\"requestError\"` hook\nto log errors:\n\n```typescript\nimport { InkeepAnalytics } from \"@inkeep/inkeep-analytics\";\nimport { HTTPClient } from \"@inkeep/inkeep-analytics/lib/http\";\n\nconst httpClient = new HTTPClient({\n  // fetcher takes a function that has the same signature as native `fetch`.\n  fetcher: (request) =\u003e {\n    return fetch(request);\n  }\n});\n\nhttpClient.addHook(\"beforeRequest\", (request) =\u003e {\n  const nextRequest = new Request(request, {\n    signal: request.signal || AbortSignal.timeout(5000)\n  });\n\n  nextRequest.headers.set(\"x-custom-header\", \"custom value\");\n\n  return nextRequest;\n});\n\nhttpClient.addHook(\"requestError\", (error, request) =\u003e {\n  console.group(\"Request Error\");\n  console.log(\"Reason:\", `${error}`);\n  console.log(\"Endpoint:\", `${request.method} ${request.url}`);\n  console.groupEnd();\n});\n\nconst sdk = new InkeepAnalytics({ httpClient: httpClient });\n```\n\u003c!-- End Custom HTTP Client [http-client] --\u003e\n\n\u003c!-- Start Debugging [debug] --\u003e\n## Debugging\n\nYou can setup your SDK to emit debug logs for SDK requests and responses.\n\nYou can pass a logger that matches `console`'s interface as an SDK option.\n\n\u003e [!WARNING]\n\u003e Beware that debug logging will reveal secrets, like API tokens in headers, in log messages printed to a console or files. It's recommended to use this feature only during local development and not in production.\n\n```typescript\nimport { InkeepAnalytics } from \"@inkeep/inkeep-analytics\";\n\nconst sdk = new InkeepAnalytics({ debugLogger: console });\n```\n\nYou can also enable a default debug logger by setting an environment variable `INKEEPANALYTICS_DEBUG` to true.\n\u003c!-- End Debugging [debug] --\u003e\n\n\u003c!-- Placeholder for Future Speakeasy SDK Sections --\u003e\n\n# Development\n\n## Maturity\n\nThis SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage\nto a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally\nlooking for the latest version.\n\n## Contributions\n\nWhile we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation. \nWe look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release. \n\n### SDK Created by [Speakeasy](https://www.speakeasy.com/?utm_source=inkeep-analytics-typescript\u0026utm_campaign=typescript)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finkeep%2Finkeep-analytics-typescript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finkeep%2Finkeep-analytics-typescript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finkeep%2Finkeep-analytics-typescript/lists"}