{"_id":"@axle-insure/sdk","name":"@axle-insure/sdk","dist-tags":{"beta":"0.1.0-beta.0","latest":"0.1.0-beta.0"},"versions":{"0.1.0-beta.0":{"name":"@axle-insure/sdk","version":"0.1.0-beta.0","author":{"name":"Axle"},"description":"TypeScript SDK for the Axle Public API.","license":"MIT","publishConfig":{"access":"public"},"type":"module","main":"./esm/index.js","exports":{".":{"source":"./src/index.ts","types":"./esm/index.d.ts","default":"./esm/index.js"},"./package.json":"./package.json","./types":{"source":"./src/types/index.ts","types":"./esm/types/index.d.ts","default":"./esm/types/index.js"},"./models/errors":{"source":"./src/models/errors/index.ts","types":"./esm/models/errors/index.d.ts","default":"./esm/models/errors/index.js"},"./models":{"source":"./src/models/index.ts","types":"./esm/models/index.d.ts","default":"./esm/models/index.js"},"./models/operations":{"source":"./src/models/operations/index.ts","types":"./esm/models/operations/index.d.ts","default":"./esm/models/operations/index.js"},"./*.js":{"source":"./src/*.ts","types":"./esm/*.d.ts","default":"./esm/*.js"},"./*":{"source":"./src/*.ts","types":"./esm/*.d.ts","default":"./esm/*.js"}},"sideEffects":false,"scripts":{"lint":"oxlint --max-warnings=0 --deny-warnings --no-error-on-unmatched-pattern src","build":"tsgo","prepublishOnly":"npm run build"},"peerDependencies":{},"devDependencies":{"@typescript/native-preview":"7.0.0-dev.20260302.1","oxlint":"^1.60.0","typescript":"~5.8.3"},"dependencies":{"zod":"^3.25.65 || ^4.0.0"},"_id":"@axle-insure/sdk@0.1.0-beta.0","gitHead":"b89293e89e8bab07e4e812908a33aa570a89c15f","types":"./esm/index.d.ts","_nodeVersion":"20.20.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-r61SFGyPATBiVb5a2FKn9g+xepqAJgBkvKbayqv0xrRWrgoMI0kOVe/Iv7PjrEB9LHLbzDwOp8pWRfUeDmLIyg==","shasum":"669bef1773cb44759814c8bcbaebd26d462e14aa","tarball":"https://registry.npmjs.org/@axle-insure/sdk/-/sdk-0.1.0-beta.0.tgz","fileCount":1045,"unpackedSize":1425197,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCQVHH7vVNN1q1tOwxumGS6qySGjybGFY76hN56mP0/3QIgTNmYSzfTSjfaZB6SpxUvY0TskfETwvH79HAtUJ1xY+c="}]},"_npmUser":{"name":"axle-alexanimal","email":"david@axle.insure"},"directories":{},"maintainers":[{"name":"axle-alexanimal","email":"david@axle.insure"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_0.1.0-beta.0_1787253640153_0.3708044352410085"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-20T19:20:39.926Z","0.1.0-beta.0":"2026-08-20T19:20:40.329Z","modified":"2026-08-20T19:20:40.598Z"},"maintainers":[{"name":"axle-alexanimal","email":"david@axle.insure"}],"description":"TypeScript SDK for the Axle Public API.","author":{"name":"Axle"},"license":"MIT","readme":"# @axle-insure/sdk\n\nDeveloper-friendly & type-safe Typescript SDK specifically catered to leverage *Axle Public API* API.\n\n[![Built by Speakeasy](https://img.shields.io/badge/Built_by-SPEAKEASY-374151?style=for-the-badge&labelColor=f3f4f6)](https://www.speakeasy.com/?utm_source=@axle-insure/sdk&utm_campaign=typescript)\n[![License: MIT](https://img.shields.io/badge/LICENSE_//_MIT-3b5bdb?style=for-the-badge&labelColor=eff6ff)](https://opensource.org/licenses/MIT)\n\n<!-- Start Summary [summary] -->\n## Summary\n\nAxle Public API: Axle's public API. Every route is authenticated with the x-client-id and x-client-secret\npair issued with your account; account and policy reads additionally require the\nx-access-token returned by /token/exchange.\n\nEvery response carries an x-axle-request-id header. Quote it in support requests.\nThe `message` field on an error is human-readable and must not be parsed.\n<!-- End Summary [summary] -->\n\n<!-- Start Table of Contents [toc] -->\n## Table of Contents\n<!-- $toc-max-depth=2 -->\n* [@axle-insure/sdk](#axle-insuresdk)\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  * [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<!-- End Table of Contents [toc] -->\n\n<!-- Start SDK Installation [installation] -->\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 @axle-insure/sdk\n```\n\n### PNPM\n\n```bash\npnpm add @axle-insure/sdk\n```\n\n### Bun\n\n```bash\nbun add @axle-insure/sdk\n```\n\n### Yarn\n\n```bash\nyarn add @axle-insure/sdk\n```\n\n> [!NOTE]\n> This package is published as an ES Module (ESM) only. For applications using\n> CommonJS, use `await import(\"@axle-insure/sdk\")` to import and use this package.\n<!-- End SDK Installation [installation] -->\n\n<!-- Start Requirements [requirements] -->\n## Requirements\n\nFor supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md).\n<!-- End Requirements [requirements] -->\n\n<!-- Start SDK Example Usage [usage] -->\n## SDK Example Usage\n\n### Example\n\n```typescript\nimport { Axle } from \"@axle-insure/sdk\";\n\nconst axle = new Axle({\n  security: {\n    clientId: \"<YOUR_API_KEY_HERE>\",\n    clientSecret: \"<YOUR_API_KEY_HERE>\",\n  },\n});\n\nasync function run() {\n  const result = await axle.accounts.get({\n    account: \"53734505\",\n    accessToken: \"<value>\",\n  });\n\n  console.log(result);\n}\n\nrun();\n\n```\n<!-- End SDK Example Usage [usage] -->\n\n<!-- Start Authentication [security] -->\n## Authentication\n\n### Per-Client Security Schemes\n\nThis SDK supports the following security schemes globally:\n\n| Name           | Type   | Scheme  |\n| -------------- | ------ | ------- |\n| `clientId`     | apiKey | API key |\n| `clientSecret` | apiKey | API key |\n\nYou can set the security parameters through the `security` optional parameter when initializing the SDK client instance. The selected scheme will be used by default to authenticate with the API for all operations that support it. For example:\n```typescript\nimport { Axle } from \"@axle-insure/sdk\";\n\nconst axle = new Axle({\n  security: {\n    clientId: \"<YOUR_API_KEY_HERE>\",\n    clientSecret: \"<YOUR_API_KEY_HERE>\",\n  },\n});\n\nasync function run() {\n  const result = await axle.accounts.get({\n    account: \"53734505\",\n    accessToken: \"<value>\",\n  });\n\n  console.log(result);\n}\n\nrun();\n\n```\n<!-- End Authentication [security] -->\n\n<!-- Start Available Resources and Operations [operations] -->\n## Available Resources and Operations\n\n<details open>\n<summary>Available methods</summary>\n\n### [Accounts](docs/sdks/accounts/README.md)\n\n* [get](docs/sdks/accounts/README.md#get)\n* [getPolicy](docs/sdks/accounts/README.md#getpolicy)\n\n### [Carriers](docs/sdks/carriers/README.md)\n\n* [list](docs/sdks/carriers/README.md#list)\n* [get](docs/sdks/carriers/README.md#get)\n\n### [Ignition](docs/sdks/ignition/README.md)\n\n* [start](docs/sdks/ignition/README.md#start)\n* [proxy](docs/sdks/ignition/README.md#proxy) - The path variable binds to `ignition_token`, so the URL reads /ignition/{ignitionToken}/proxy.\n\n### [Platform](docs/sdks/platform/README.md)\n\n* [listClients](docs/sdks/platform/README.md#listclients)\n* [createClient](docs/sdks/platform/README.md#createclient)\n* [createTemplate](docs/sdks/platform/README.md#createtemplate)\n\n### [Policies](docs/sdks/policies/README.md)\n\n* [executeAction](docs/sdks/policies/README.md#executeaction)\n* [get](docs/sdks/policies/README.md#get)\n* [getReport](docs/sdks/policies/README.md#getreport)\n* [validate](docs/sdks/policies/README.md#validate)\n* [validateWithTemplate](docs/sdks/policies/README.md#validatewithtemplate)\n\n### [Sandbox](docs/sdks/sandbox/README.md)\n\n* [triggerAccountEvent](docs/sdks/sandbox/README.md#triggeraccountevent)\n* [triggerPolicyEvent](docs/sdks/sandbox/README.md#triggerpolicyevent)\n\n### [Templates](docs/sdks/templates/README.md)\n\n* [list](docs/sdks/templates/README.md#list)\n* [create](docs/sdks/templates/README.md#create)\n* [get](docs/sdks/templates/README.md#get)\n* [update](docs/sdks/templates/README.md#update)\n\n### [Tokens](docs/sdks/tokens/README.md)\n\n* [descope](docs/sdks/tokens/README.md#descope)\n* [exchange](docs/sdks/tokens/README.md#exchange)\n\n### [Widgets](docs/sdks/widgets/README.md)\n\n* [start](docs/sdks/widgets/README.md#start)\n\n</details>\n<!-- End Available Resources and Operations [operations] -->\n\n<!-- Start Standalone functions [standalone-funcs] -->\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<details>\n\n<summary>Available standalone functions</summary>\n\n- [`accountsGet`](docs/sdks/accounts/README.md#get)\n- [`accountsGetPolicy`](docs/sdks/accounts/README.md#getpolicy)\n- [`carriersGet`](docs/sdks/carriers/README.md#get)\n- [`carriersList`](docs/sdks/carriers/README.md#list)\n- [`ignitionProxy`](docs/sdks/ignition/README.md#proxy) - The path variable binds to `ignition_token`, so the URL reads /ignition/{ignitionToken}/proxy.\n- [`ignitionStart`](docs/sdks/ignition/README.md#start)\n- [`platformCreateClient`](docs/sdks/platform/README.md#createclient)\n- [`platformCreateTemplate`](docs/sdks/platform/README.md#createtemplate)\n- [`platformListClients`](docs/sdks/platform/README.md#listclients)\n- [`policiesExecuteAction`](docs/sdks/policies/README.md#executeaction)\n- [`policiesGet`](docs/sdks/policies/README.md#get)\n- [`policiesGetReport`](docs/sdks/policies/README.md#getreport)\n- [`policiesValidate`](docs/sdks/policies/README.md#validate)\n- [`policiesValidateWithTemplate`](docs/sdks/policies/README.md#validatewithtemplate)\n- [`sandboxTriggerAccountEvent`](docs/sdks/sandbox/README.md#triggeraccountevent)\n- [`sandboxTriggerPolicyEvent`](docs/sdks/sandbox/README.md#triggerpolicyevent)\n- [`templatesCreate`](docs/sdks/templates/README.md#create)\n- [`templatesGet`](docs/sdks/templates/README.md#get)\n- [`templatesList`](docs/sdks/templates/README.md#list)\n- [`templatesUpdate`](docs/sdks/templates/README.md#update)\n- [`tokensDescope`](docs/sdks/tokens/README.md#descope)\n- [`tokensExchange`](docs/sdks/tokens/README.md#exchange)\n- [`widgetsStart`](docs/sdks/widgets/README.md#start)\n\n</details>\n<!-- End Standalone functions [standalone-funcs] -->\n\n<!-- Start Retries [retries] -->\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 { Axle } from \"@axle-insure/sdk\";\n\nconst axle = new Axle({\n  security: {\n    clientId: \"<YOUR_API_KEY_HERE>\",\n    clientSecret: \"<YOUR_API_KEY_HERE>\",\n  },\n});\n\nasync function run() {\n  const result = await axle.accounts.get({\n    account: \"53734505\",\n    accessToken: \"<value>\",\n  }, {\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 { Axle } from \"@axle-insure/sdk\";\n\nconst axle = new Axle({\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  security: {\n    clientId: \"<YOUR_API_KEY_HERE>\",\n    clientSecret: \"<YOUR_API_KEY_HERE>\",\n  },\n});\n\nasync function run() {\n  const result = await axle.accounts.get({\n    account: \"53734505\",\n    accessToken: \"<value>\",\n  });\n\n  console.log(result);\n}\n\nrun();\n\n```\n<!-- End Retries [retries] -->\n\n<!-- Start Error Handling [errors] -->\n## Error Handling\n\n[`SDKError`](./src/models/errors/sdk-error.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 { Axle } from \"@axle-insure/sdk\";\nimport * as errors from \"@axle-insure/sdk/models/errors\";\n\nconst axle = new Axle({\n  security: {\n    clientId: \"<YOUR_API_KEY_HERE>\",\n    clientSecret: \"<YOUR_API_KEY_HERE>\",\n  },\n});\n\nasync function run() {\n  try {\n    const result = await axle.accounts.get({\n      account: \"53734505\",\n      accessToken: \"<value>\",\n    });\n\n    console.log(result);\n  } catch (error) {\n    // The base class for HTTP error responses\n    if (error instanceof errors.SDKError) {\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.ErrorResponse) {\n        console.log(error.data$.success); // boolean\n        console.log(error.data$.message); // string\n        console.log(error.data$.errorCode); // string\n      }\n    }\n  }\n}\n\nrun();\n\n```\n\n### Error Classes\n**Primary errors:**\n* [`SDKError`](./src/models/errors/sdk-error.ts): The base class for HTTP error responses.\n  * [`ErrorResponse`](./src/models/errors/error-response.ts): An error produced by the Axle handler. Never parse `message`.\n\n<details><summary>Less common errors (6)</summary>\n\n<br />\n\n**Network errors:**\n* [`ConnectionError`](./src/models/errors/http-client-errors.ts): HTTP client was unable to make a request to a server.\n* [`RequestTimeoutError`](./src/models/errors/http-client-errors.ts): HTTP request timed out due to an AbortSignal signal.\n* [`RequestAbortedError`](./src/models/errors/http-client-errors.ts): HTTP request was aborted by the client.\n* [`InvalidRequestError`](./src/models/errors/http-client-errors.ts): Any input used to create a request is invalid.\n* [`UnexpectedClientError`](./src/models/errors/http-client-errors.ts): Unrecognised or unexpected error.\n\n\n**Inherit from [`SDKError`](./src/models/errors/sdk-error.ts)**:\n* [`ResponseValidationError`](./src/models/errors/response-validation-error.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</details>\n<!-- End Error Handling [errors] -->\n\n<!-- Start Server Selection [server] -->\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: number` 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                        | Description                     |\n| --- | ----------------------------- | ------------------------------- |\n| 0   | `https://api.axle.insure`     | Production                      |\n| 1   | `https://sandbox.axle.insure` | Sandbox. Test credentials only. |\n\n#### Example\n\n```typescript\nimport { Axle } from \"@axle-insure/sdk\";\n\nconst axle = new Axle({\n  serverIdx: 0,\n  security: {\n    clientId: \"<YOUR_API_KEY_HERE>\",\n    clientSecret: \"<YOUR_API_KEY_HERE>\",\n  },\n});\n\nasync function run() {\n  const result = await axle.accounts.get({\n    account: \"53734505\",\n    accessToken: \"<value>\",\n  });\n\n  console.log(result);\n}\n\nrun();\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: string` optional parameter when initializing the SDK client instance. For example:\n```typescript\nimport { Axle } from \"@axle-insure/sdk\";\n\nconst axle = new Axle({\n  serverURL: \"https://sandbox.axle.insure\",\n  security: {\n    clientId: \"<YOUR_API_KEY_HERE>\",\n    clientSecret: \"<YOUR_API_KEY_HERE>\",\n  },\n});\n\nasync function run() {\n  const result = await axle.accounts.get({\n    account: \"53734505\",\n    accessToken: \"<value>\",\n  });\n\n  console.log(result);\n}\n\nrun();\n\n```\n<!-- End Server Selection [server] -->\n\n<!-- Start Custom HTTP Client [http-client] -->\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:\n- route requests through a proxy server using [undici](https://www.npmjs.com/package/undici)'s ProxyAgent\n- use the `\"beforeRequest\"` hook to add a custom header and a timeout to requests\n- use the `\"requestError\"` hook to log errors\n\n```typescript\nimport { Axle } from \"@axle-insure/sdk\";\nimport { ProxyAgent } from \"undici\";\nimport { HTTPClient } from \"@axle-insure/sdk/lib/http\";\n\nconst dispatcher = new ProxyAgent(\"http://proxy.example.com:8080\");\n\nconst httpClient = new HTTPClient({\n  // 'fetcher' takes a function that has the same signature as native 'fetch'.\n  fetcher: (input, init) =>\n    // 'dispatcher' is specific to undici and not part of the standard Fetch API.\n    fetch(input, { ...init, dispatcher } as RequestInit),\n});\n\nhttpClient.addHook(\"beforeRequest\", (request) => {\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) => {\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 Axle({ httpClient: httpClient });\n```\n<!-- End Custom HTTP Client [http-client] -->\n\n<!-- Start Debugging [debug] -->\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> [!WARNING]\n> 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 { Axle } from \"@axle-insure/sdk\";\n\nconst sdk = new Axle({ debugLogger: console });\n```\n<!-- End Debugging [debug] -->\n\n<!-- Placeholder for Future Speakeasy SDK Sections -->\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=@axle-insure/sdk&utm_campaign=typescript)\n","readmeFilename":"README.md","_rev":"1-c1348c682c252356d825d4f7b3efd146"}