{"id":20886267,"url":"https://github.com/axe-api/client","last_synced_at":"2026-02-09T15:01:35.433Z","repository":{"id":182855940,"uuid":"631217939","full_name":"axe-api/client","owner":"axe-api","description":"axe-api-client is a native JavaScript client for Axe API servers.","archived":false,"fork":false,"pushed_at":"2024-11-18T01:54:15.000Z","size":1001,"stargazers_count":2,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-05T06:36:42.911Z","etag":null,"topics":["activerecord","api","api-rest","axe-api","js-client","rest-api","restful","restful-api"],"latest_commit_sha":null,"homepage":"https://axe-api.com/learn/javascript-client-axe-api-client.html","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/axe-api.png","metadata":{"files":{"readme":"readme.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"open_collective":"https://opencollective.com/axe-api"}},"created_at":"2023-04-22T10:11:13.000Z","updated_at":"2024-09-28T08:57:10.000Z","dependencies_parsed_at":"2023-12-03T08:30:33.473Z","dependency_job_id":"45a064b3-6f7b-4640-af4b-c23c5192cf74","html_url":"https://github.com/axe-api/client","commit_stats":{"total_commits":57,"total_committers":2,"mean_commits":28.5,"dds":0.4035087719298246,"last_synced_commit":"f6aaea03241fae930d8e7ad392bf802543611b17"},"previous_names":["axe-api/client"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axe-api%2Fclient","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axe-api%2Fclient/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axe-api%2Fclient/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axe-api%2Fclient/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/axe-api","download_url":"https://codeload.github.com/axe-api/client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253284081,"owners_count":21883754,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["activerecord","api","api-rest","axe-api","js-client","rest-api","restful","restful-api"],"created_at":"2024-11-18T08:16:21.381Z","updated_at":"2026-02-09T15:01:35.363Z","avatar_url":"https://github.com/axe-api.png","language":"TypeScript","readme":"\u003ch1 align=\"center\"\u003e\n  \u003cbr\u003e\n  \u003ca href=\"https://axe-api.com/\"\u003e\n    \u003cimg src=\"https://axe-api.com/axe.png\" alt=\"Markdownify\" width=\"200\"\u003e\n  \u003c/a\u003e\n  \u003cbr\u003e\n  Axe API Client\n  \u003cbr\u003e\n  \u003ca href=\"https://badge.fury.io/js/axe-api-client\"\u003e\n    \u003cimg src=\"https://badge.fury.io/js/axe-api-client.svg\" alt=\"npm version\" height=\"18\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/axe-api/client/actions/workflows/npm-release-publish.yml\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://github.com/axe-api/client/actions/workflows/npm-release-publish.yml/badge.svg?branch=master\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://sonarcloud.io/dashboard?id=axe-api_client\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://sonarcloud.io/api/project_badges/measure?project=axe-api_client\u0026metric=alert_status\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/axe-api/client/issues\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/issues/axe-api/axe-api.svg\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://opensource.org/licenses/MIT\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/license-MIT-blue.svg\"\u003e\n  \u003c/a\u003e\n\u003c/h1\u003e\n\n`axe-api-client` is a native JavaScript client for Axe API servers.\n\nYou can send insert, update, delete, and fetch data from Axe API servers without pain. `axe-api-client` has advanced query support with the active record pattern.\n\n## ⚙️ Config\n\n```ts\nimport { api, IRequest } from \"axe-api-client\";\n\napi.setConfig({\n  baseURL: \"https://bookstore.axe-api.com/api/v1\",\n  headers: {},\n  params: {},\n});\n\napi.interceptors.addRequest((request: IRequest) =\u003e {\n  return request;\n});\n\napi.interceptors.addResponse((response: Response) =\u003e {\n  // console.log(response);\n});\n```\n\n## ➕ Insert\n\n```js\nconst response = await api.resource(\"users\").insert({\n  name: \"Karl\",\n  surname: \"Popper\",\n});\n```\n\n## 📤 Post\n\n```js\nconst response = await api.resource(\"users\").post({\n  name: \"Karl\",\n  surname: \"Popper\",\n});\n```\n\n## 🔄 Update\n\n```js\nconst response = await api.resource(\"users\").update({\n  name: \"Karl\",\n  surname: \"Popper\",\n});\n```\n\n## 🩹 Patch\n\n```js\nconst response = await api.resource(\"users\").patch({\n  name: \"Karl\",\n  surname: \"Popper\",\n});\n```\n\n## ✏️ Put\n\n```js\nconst response = await api.resource(\"users\").put({\n  name: \"Karl\",\n  surname: \"Popper\",\n});\n```\n\n## 🗑️ Delete\n\n```js\nconst response = await api.resource(\"users\").delete();\n```\n\n## 🔍 Query\n\n```js\nimport { api } from \"axe-api-client\";\n\nconst data = await api.resource(\"users\").paginate();\n```\n\n## 📝 Fields\n\n```js\nconst response = await api\n  .resource(\"users\")\n  .fields(\"name\", \"surname\", \"email\")\n  .paginate();\n```\n\n## 🧩 Sorting\n\n```js\nconst response = await api\n  .resource(\"users\")\n  .fields(\"name\", \"surname\", \"email\")\n  .sort(\"name\")\n  .sort(\"surname\", \"DESC\")\n  .sort(\"email\", \"ASC\")\n  .paginate();\n```\n\n## 🚦 Limits\n\n```js\nconst response = await api.resource(\"users\").paginate({ page: 1, perPage: 25 });\n```\n\n## ⏩ First\n\n```js\nconst response = await api.resource(\"users\").first();\n```\n\n## ❓ Where Conditions\n\n```js\nconst response = await api.resource(\"users\").where(\"age\", 18).paginate();\n```\n\n```js\nconst response = await api\n  .resource(\"users\")\n  .where(\"age\", \"\u003e=\", 18)\n  .where(\"name\", \"Karl\")\n  .paginate();\n```\n\n```js\nconst response = await api\n  .resource(\"users\")\n  .where(\"age\", \"\u003e=\", 18)\n  .orWhere(\"name\", \"Karl\")\n  .paginate();\n```\n\n```js\nconst response = await api\n  .resource(\"users\")\n  .where(\"age\", \"\u003e=\", 18)\n  .andWhere(\"name\", \"Karl\")\n  .paginate();\n```\n\n```js\nconst response = await api\n  .resource(\"users\")\n  .where((query) =\u003e {\n    query.where(\"name\", \"Karl\").where(\"surname\", \"Popper\");\n  })\n  .orWhere(\"age\", \"\u003e=\", 18)\n  .paginate();\n```\n\n```js\nconst response = await api\n  .resource(\"users\")\n  .where(\"age\", \"IN\", [18, 19, 20])\n  .paginate();\n```\n\n\u003e All the [operators](https://axe-api.com/basics/queries/index.html#operators) should be able to used.\n\n## 🔗 Related Data\n\n```js\nconst response = await api\n  .resource(\"users\")\n  .with(\"posts{comments{id|content}}\")\n  .paginate();\n```\n\n## ⚡ Quick where functions\n\nWe can use the following query where functions:\n\n- `whereNot(\"id\", 1)`\n- `whereLike(\"name\", \"*john*\")`\n- `whereNotLike(\"name\", \"*john*\")`\n- `whereIn(\"type\", [1, 2, 3])`\n- `whereNotIn(\"type\", [1, 2, 3])`\n- `whereBetween(\"type\", 1, 3)`\n- `whereNotBetween(\"type\", 1, 3)`\n- `whereNull(\"age\")`\n- `whereNotNull(\"age\")`\n\n## 👥 Contributors\n\n\u003ca href=\"https://github.com/axe-api/client/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=axe-api/client\" /\u003e\n\u003c/a\u003e\n\nMade with [contrib.rocks](https://contrib.rocks).\n\n## 📜 License\n\n[MIT License](LICENSE)\n","funding_links":["https://opencollective.com/https://opencollective.com/axe-api"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxe-api%2Fclient","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faxe-api%2Fclient","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxe-api%2Fclient/lists"}