{"id":38851035,"url":"https://github.com/ioniccommerce/ionic_sdk_ts","last_synced_at":"2026-01-17T14:12:24.024Z","repository":{"id":224586595,"uuid":"763682922","full_name":"ioniccommerce/ionic_sdk_ts","owner":"ioniccommerce","description":"Ionic Commerce TypeScript SDK","archived":false,"fork":false,"pushed_at":"2025-01-20T00:25:16.000Z","size":1392,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-09T18:58:47.136Z","etag":null,"topics":["ai","ecommerce","nodejs","shopping","typescript"],"latest_commit_sha":null,"homepage":"https://ioniccommerce.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ioniccommerce.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2024-02-26T18:26:06.000Z","updated_at":"2024-05-01T22:49:32.000Z","dependencies_parsed_at":"2024-03-26T23:22:48.100Z","dependency_job_id":"461ef43a-56cc-4c73-929b-7f743cccf65a","html_url":"https://github.com/ioniccommerce/ionic_sdk_ts","commit_stats":{"total_commits":27,"total_committers":4,"mean_commits":6.75,"dds":"0.18518518518518523","last_synced_commit":"0519148539c363b2f6f8ea90a6ed7ad28d0ae91f"},"previous_names":["ioniccommerce/ionic_sdk_ts"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/ioniccommerce/ionic_sdk_ts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ioniccommerce%2Fionic_sdk_ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ioniccommerce%2Fionic_sdk_ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ioniccommerce%2Fionic_sdk_ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ioniccommerce%2Fionic_sdk_ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ioniccommerce","download_url":"https://codeload.github.com/ioniccommerce/ionic_sdk_ts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ioniccommerce%2Fionic_sdk_ts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28509939,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T13:38:16.342Z","status":"ssl_error","status_checked_at":"2026-01-17T13:37:44.060Z","response_time":85,"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":["ai","ecommerce","nodejs","shopping","typescript"],"created_at":"2026-01-17T14:12:23.944Z","updated_at":"2026-01-17T14:12:24.002Z","avatar_url":"https://github.com/ioniccommerce.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ionic-API\n\n\u003cdiv align=\"left\"\u003e\n    \u003ca href=\"https://speakeasyapi.dev/\"\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\u003c!-- Start SDK Installation [installation] --\u003e\n## SDK Installation\n\n### NPM\n\n```bash\nnpm add @ioniccommerce/ionic-sdk\n```\n\n### Yarn\n\n```bash\nyarn add @ioniccommerce/ionic-sdk\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 { Ionic } from \"@ioniccommerce/ionic-sdk\";\nimport { MessageRole, MessageType } from \"@ioniccommerce/ionic-sdk/models/components\";\n\nasync function run() {\n    const sdk = new Ionic();\n\n    const operationSecurity = {\n        apiKeyHeader: \"\u003cYOUR_API_KEY_HERE\u003e\",\n    };\n\n    const result = await sdk.query(\n        {\n            messages: [\n                {\n                    content: \"\u003cvalue\u003e\",\n                    role: MessageRole.System,\n                    type: MessageType.Tag,\n                },\n            ],\n            query: {\n                query: \"\u003cvalue\u003e\",\n            },\n            session: {},\n        },\n        operationSecurity\n    );\n\n    // Handle the result\n    console.log(result);\n}\n\nrun();\n\n```\n\u003c!-- End SDK Example Usage [usage] --\u003e\n\n\u003c!-- Start Available Resources and Operations [operations] --\u003e\n## Available Resources and Operations\n\n### [Ionic SDK](docs/sdks/ionic/README.md)\n\n* [query](docs/sdks/ionic/README.md#query) - Product Search\n\u003c!-- End Available Resources and Operations [operations] --\u003e\n\n\u003c!-- Start Error Handling [errors] --\u003e\n## Error Handling\n\nAll SDK methods return a response object or throw an error. If Error objects are specified in your OpenAPI Spec, the SDK will throw the appropriate Error type.\n\n| Error Object               | Status Code                | Content Type               |\n| -------------------------- | -------------------------- | -------------------------- |\n| errors.HTTPValidationError | 422                        | application/json           |\n| errors.SDKError            | 4xx-5xx                    | */*                        |\n\nValidation errors can also occur when either method arguments or data returned from the server do not match the expected format. The `SDKValidationError` that is thrown as a result will capture the raw value that failed validation in an attribute called `rawValue`. Additionally, a `pretty()` method is available on this error that can be used to log a nicely formatted string since validation errors can list many issues and the plain error string may be difficult read when debugging. \n\n\n```typescript\nimport { Ionic } from \"@ioniccommerce/ionic-sdk\";\nimport { MessageRole, MessageType } from \"@ioniccommerce/ionic-sdk/models/components\";\nimport * as errors from \"@ioniccommerce/ionic-sdk/models/errors\";\n\nasync function run() {\n    const sdk = new Ionic();\n\n    const operationSecurity = {\n        apiKeyHeader: \"\u003cYOUR_API_KEY_HERE\u003e\",\n    };\n\n    let result;\n    try {\n        result = await sdk.query(\n            {\n                messages: [\n                    {\n                        content: \"\u003cvalue\u003e\",\n                        role: MessageRole.System,\n                        type: MessageType.Tag,\n                    },\n                ],\n                query: {\n                    query: \"\u003cvalue\u003e\",\n                },\n                session: {},\n            },\n            operationSecurity\n        );\n    } catch (err) {\n        switch (true) {\n            case err instanceof errors.SDKValidationError: {\n                // Validation errors can be pretty-printed\n                console.error(err.pretty());\n                // Raw value may also be inspected\n                console.error(err.rawValue);\n                return;\n            }\n            case err instanceof errors.HTTPValidationError: {\n                console.error(err); // handle exception\n                return;\n            }\n            default: {\n                throw err;\n            }\n        }\n    }\n\n    // Handle the result\n    console.log(result);\n}\n\nrun();\n\n```\n\u003c!-- End Error Handling [errors] --\u003e\n\n\u003c!-- Start Server Selection [server] --\u003e\n## Server Selection\n\n### Select Server by Index\n\nYou can override the default server globally by passing a server index to the `serverIdx` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:\n\n| # | Server | Variables |\n| - | ------ | --------- |\n| 0 | `https://api.ioniccommerce.com` | None |\n\n```typescript\nimport { Ionic } from \"@ioniccommerce/ionic-sdk\";\nimport { MessageRole, MessageType } from \"@ioniccommerce/ionic-sdk/models/components\";\n\nasync function run() {\n    const sdk = new Ionic({\n        serverIdx: 0,\n    });\n\n    const operationSecurity = {\n        apiKeyHeader: \"\u003cYOUR_API_KEY_HERE\u003e\",\n    };\n\n    const result = await sdk.query(\n        {\n            messages: [\n                {\n                    content: \"\u003cvalue\u003e\",\n                    role: MessageRole.System,\n                    type: MessageType.Tag,\n                },\n            ],\n            query: {\n                query: \"\u003cvalue\u003e\",\n            },\n            session: {},\n        },\n        operationSecurity\n    );\n\n    // Handle the result\n    console.log(result);\n}\n\nrun();\n\n```\n\n\n### Override Server URL Per-Client\n\nThe default server can also be overridden globally by passing a URL to the `serverURL` optional parameter when initializing the SDK client instance. For example:\n\n```typescript\nimport { Ionic } from \"@ioniccommerce/ionic-sdk\";\nimport { MessageRole, MessageType } from \"@ioniccommerce/ionic-sdk/models/components\";\n\nasync function run() {\n    const sdk = new Ionic({\n        serverURL: \"https://api.ioniccommerce.com\",\n    });\n\n    const operationSecurity = {\n        apiKeyHeader: \"\u003cYOUR_API_KEY_HERE\u003e\",\n    };\n\n    const result = await sdk.query(\n        {\n            messages: [\n                {\n                    content: \"\u003cvalue\u003e\",\n                    role: MessageRole.System,\n                    type: MessageType.Tag,\n                },\n            ],\n            query: {\n                query: \"\u003cvalue\u003e\",\n            },\n            session: {},\n        },\n        operationSecurity\n    );\n\n    // Handle the result\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 { Ionic } from \"@ioniccommerce/ionic-sdk\";\nimport { HTTPClient } from \"@ioniccommerce/ionic-sdk/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 Ionic({ httpClient });\n```\n\u003c!-- End Custom HTTP Client [http-client] --\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         |\n| -------------- | -------------- | -------------- |\n| `apiKeyHeader` | apiKey         | API key        |\n\nTo authenticate with the API the `apiKeyHeader` parameter must be set when initializing the SDK client instance. For example:\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 { Ionic } from \"@ioniccommerce/ionic-sdk\";\nimport { MessageRole, MessageType } from \"@ioniccommerce/ionic-sdk/models/components\";\n\nasync function run() {\n    const sdk = new Ionic();\n\n    const operationSecurity = {\n        apiKeyHeader: \"\u003cYOUR_API_KEY_HERE\u003e\",\n    };\n\n    const result = await sdk.query(\n        {\n            messages: [\n                {\n                    content: \"\u003cvalue\u003e\",\n                    role: MessageRole.System,\n                    type: MessageType.Tag,\n                },\n            ],\n            query: {\n                query: \"\u003cvalue\u003e\",\n            },\n            session: {},\n        },\n        operationSecurity\n    );\n\n    // Handle the result\n    console.log(result);\n}\n\nrun();\n\n```\n\u003c!-- End Authentication [security] --\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.\nFeel free to open a PR or a Github issue as a proof of concept and we'll do our best to include it in a future release!\n\n### SDK Created by [Speakeasy](https://docs.speakeasyapi.dev/docs/using-speakeasy/client-sdks)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fioniccommerce%2Fionic_sdk_ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fioniccommerce%2Fionic_sdk_ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fioniccommerce%2Fionic_sdk_ts/lists"}