{"_id":"@ahsan-iftikhar-114/api-toolkit-react-query","_rev":"3-e15d9c8ab970a10cc8d5dc2793a7f094","name":"@ahsan-iftikhar-114/api-toolkit-react-query","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@ahsan-iftikhar-114/api-toolkit-react-query","version":"1.0.0","keywords":["react","react-query","tanstack-query","axios","typescript","api","api-client","react-api","react-api-client","react-query-axios","tanstack-query-axios","axios-react-query","api-toolkit","api-hooks","react-hooks","query-hooks","mutation-hooks","rest-api","rest-api-client","typescript-api-client","api-cache","cache-invalidation","request-cancellation","react-query-cache","react-query-typescript","axios-typescript"],"author":{"name":"Ahsan Iftikhar"},"license":"MIT","_id":"@ahsan-iftikhar-114/api-toolkit-react-query@1.0.0","maintainers":[{"name":"ahsan-iftikhar-114","email":"em.ahsaniftikhar@gmail.com"}],"dist":{"shasum":"0487f7fadf08dbb7d6244b3719dbff5930bc0c4e","tarball":"https://registry.npmjs.org/@ahsan-iftikhar-114/api-toolkit-react-query/-/api-toolkit-react-query-1.0.0.tgz","fileCount":23,"integrity":"sha512-8uvkWj1R6+TYe369XkFlRwea+3QC5/4kzylJcEKg+4m8sLAGDh5f0Ik1cgCCFfrG/tYkKq+Y7pNlNw3jprBNgQ==","signatures":[{"sig":"MEUCIDJz5jeeyeNTs7OMZkoDEF9cSlox28tZgKt5e3YpmXRaAiEAy6qPfizQ0oI97G7GR/lVhfykFyHG1KquO8cuI3mwoH4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":37992},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"695b77ffbb2b3df8823c4b22fc31ca53ea403a7e","scripts":{"build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"ahsan-iftikhar-114","email":"em.ahsaniftikhar@gmail.com"},"_npmVersion":"11.6.2","description":"A generic API toolkit for React applications using Axios and TanStack Query.","directories":{},"_nodeVersion":"24.13.0","dependencies":{"axios":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.0.0","@types/react":"^19.0.0","@types/react-dom":"^19.0.0","@tanstack/react-query":"^5.0.0"},"peerDependencies":{"react":">=18.0.0","@tanstack/react-query":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/api-toolkit-react-query_1.0.0_1789021062992_0.23189267365378607","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@ahsan-iftikhar-114/api-toolkit-react-query","version":"1.0.1","keywords":["react-api","react-api-client","react-api-toolkit","react-api-library","react-api-hooks","react-api-service","react-query","react-query-api","react-query-hooks","react-query-axios","tanstack-query","tanstack-query-api","tanstack-query-axios","tanstack-query-hooks","axios","axios-react","axios-react-query","axios-api-client","axios-typescript","api-client","api-toolkit","api-hooks","api-service","generic-api-client","generic-api","typescript-api-client","typescript-api","rest-api","rest-api-client","react-rest-api","react-typescript","react-hooks","query-hooks","mutation-hooks","api-cache","api-caching","react-query-cache","cache-invalidation","query-cache","server-state","react-server-state","api-error-handling","api-authentication","bearer-token","request-cancellation","api-requests","api-management"],"author":{"name":"Ahsan Iftikhar"},"license":"MIT","_id":"@ahsan-iftikhar-114/api-toolkit-react-query@1.0.1","maintainers":[{"name":"ahsan-iftikhar-114","email":"em.ahsaniftikhar@gmail.com"}],"dist":{"shasum":"18f587465e2b2ec96128025c40e4b1a9294d2758","tarball":"https://registry.npmjs.org/@ahsan-iftikhar-114/api-toolkit-react-query/-/api-toolkit-react-query-1.0.1.tgz","fileCount":23,"integrity":"sha512-jvHfqnhCBA1hszM5DYlYWH028FvKWoJECugjnQWIdP5g2rdMQM0aFxoB+toq+P5eVlXaCaX4pp55KEULAeGTiA==","signatures":[{"sig":"MEUCIGMbp2qlhZPBHjeO2afFPjP+1CKXM9G8euv+77OQDU4QAiEAx3t025B3uSSUj3y5rOOVjVp14cRSJBjigbzMJP7kfHE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEYCIQD97iaoJh3UDu7O7wsFAJKfULL7pza2eMbMXB+TfkIV0gIhAIkP5npoiTcEWD1igK8DkQxp8wn2Uo+IsL80BgwWOaBU","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":32132},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"0c22826f3968c6eb8d42947f935a21973439602a","scripts":{"build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"ahsan-iftikhar-114","email":"em.ahsaniftikhar@gmail.com"},"_npmVersion":"11.6.2","description":"Generic React API client and API toolkit using Axios and TanStack Query for queries, mutations, caching, authentication, error handling, request cancellation, and TypeScript.","directories":{},"_nodeVersion":"24.13.0","dependencies":{"axios":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.0.0","@types/react":"^19.0.0","@types/react-dom":"^19.0.0","@tanstack/react-query":"^5.0.0"},"peerDependencies":{"react":">=18.0.0","@tanstack/react-query":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/api-toolkit-react-query_1.0.1_1789023613395_0.8308907315480725","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"_id":"@ahsan-iftikhar-114/api-toolkit-react-query@1.0.2","dist":{"shasum":"2b3b73c25222fe2be8c06abec86a01de2a483a00","tarball":"https://registry.npmjs.org/@ahsan-iftikhar-114/api-toolkit-react-query/-/api-toolkit-react-query-1.0.2.tgz","fileCount":23,"integrity":"sha512-qitjKW5AcqBhSJRTFZ5FoqswDDLVc+kJ4hsO4+OOJqedh+mJEbN6hbJm8coNg0k3eMpDItBGpahm+14rB+6JFQ==","signatures":[{"sig":"MEYCIQCNR28kMldnu967FYV3q6Cp07Xp7eRR/ntANqvH8dcS6AIhAI6Q7F23FeBsSsujWsy7AOX3TywUjHC33E8wUk7nsIyW","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAg27eWv9cVvcAarlBcRAT+GKRXPgn7KdLU+VBa2gbg7AiBo04Uc6PLm4BP399l0A/wSXYfILmPP341UnQKMpO53sg=="}],"unpackedSize":32132},"main":"dist/index.js","name":"@ahsan-iftikhar-114/api-toolkit-react-query","types":"dist/index.d.ts","author":{"name":"Ahsan Iftikhar"},"gitHead":"d90c04e85868da6292adc409167575f88339ab25","license":"MIT","scripts":{"build":"tsc","prepublishOnly":"npm run build"},"version":"1.0.2","_npmUser":{"name":"ahsan-iftikhar-114","email":"em.ahsaniftikhar@gmail.com"},"keywords":["react-api","react-api-client","react-api-toolkit","react-api-library","react-api-hooks","react-api-service","react-query","react-query-api","react-query-hooks","react-query-axios","tanstack-query","tanstack-query-api","tanstack-query-axios","tanstack-query-hooks","axios","axios-react","axios-react-query","axios-api-client","axios-typescript","api-client","api-toolkit","api-hooks","api-service","generic-api-client","generic-api","typescript-api-client","typescript-api","rest-api","rest-api-client","react-rest-api","react-typescript","react-hooks","query-hooks","mutation-hooks","api-cache","api-caching","react-query-cache","cache-invalidation","query-cache","server-state","react-server-state","api-error-handling","api-authentication","bearer-token","request-cancellation","api-requests","api-management"],"_npmVersion":"11.6.2","description":"Generic React API client and API toolkit using Axios and TanStack Query for queries, mutations, caching, authentication, error handling, request cancellation, and TypeScript.","directories":{},"maintainers":[{"name":"ahsan-iftikhar-114","email":"em.ahsaniftikhar@gmail.com"}],"_nodeVersion":"24.13.0","dependencies":{"axios":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.0.0","@types/react":"^19.0.0","@types/react-dom":"^19.0.0","@tanstack/react-query":"^5.0.0"},"peerDependencies":{"react":">=18.0.0","@tanstack/react-query":"^5.0.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/api-toolkit-react-query_1.0.2_1789023839730_0.16693307703678162"}}},"time":{"created":"2026-09-10T06:17:42.793Z","modified":"2026-09-10T07:03:59.985Z","1.0.0":"2026-09-10T06:17:43.125Z","1.0.1":"2026-09-10T07:00:13.503Z","1.0.2":"2026-09-10T07:03:59.817Z"},"author":{"name":"Ahsan Iftikhar"},"license":"MIT","keywords":["react-api","react-api-client","react-api-toolkit","react-api-library","react-api-hooks","react-api-service","react-query","react-query-api","react-query-hooks","react-query-axios","tanstack-query","tanstack-query-api","tanstack-query-axios","tanstack-query-hooks","axios","axios-react","axios-react-query","axios-api-client","axios-typescript","api-client","api-toolkit","api-hooks","api-service","generic-api-client","generic-api","typescript-api-client","typescript-api","rest-api","rest-api-client","react-rest-api","react-typescript","react-hooks","query-hooks","mutation-hooks","api-cache","api-caching","react-query-cache","cache-invalidation","query-cache","server-state","react-server-state","api-error-handling","api-authentication","bearer-token","request-cancellation","api-requests","api-management"],"description":"Generic React API client and API toolkit using Axios and TanStack Query for queries, mutations, caching, authentication, error handling, request cancellation, and TypeScript.","maintainers":[{"name":"ahsan-iftikhar-114","email":"em.ahsaniftikhar@gmail.com"}],"readme":"# @ahsan-iftikhar-114/api-toolkit-react-query\r\n\r\nA reusable API toolkit for React applications using Axios and TanStack Query.\r\n\r\nThe package provides a generic `createApi()` function for creating API queries and mutations without writing the same API setup repeatedly.\r\n\r\n## Main Function\r\n\r\nThe main function provided by this package is:\r\n\r\n```text\r\ncreateApi(name, method, url)\r\n```\r\n\r\nThis is the primary function you will use.\r\n\r\nThe same function can be used for all supported HTTP methods:\r\n\r\n```text\r\nGET\r\nPOST\r\nPUT\r\nPATCH\r\nDELETE\r\n```\r\n\r\nThe package automatically handles the API as a TanStack Query query or mutation based on the HTTP method.\r\n\r\n```text\r\nGET\r\n  ↓\r\nQuery\r\n\r\nPOST / PUT / PATCH / DELETE\r\n  ↓\r\nMutation\r\n```\r\n\r\nThis provides a consistent way to manage API communication in React applications.\r\n\r\n---\r\n\r\n## How `createApi()` works\r\n\r\n`createApi()` accepts three basic parameters:\r\n\r\n| Parameter | Description               |\r\n| --------- | ------------------------- |\r\n| `name`    | A unique name for the API |\r\n| `method`  | HTTP method               |\r\n| `url`     | API endpoint              |\r\n\r\nFor example:\r\n\r\n```text\r\ncreateApi(\"users\", \"GET\", \"/users\")\r\n```\r\n\r\nThis creates a GET API for `/users`.\r\n\r\nFor creating a user:\r\n\r\n```text\r\ncreateApi(\"create-user\", \"POST\", \"/users\")\r\n```\r\n\r\nThe function remains the same. Only the API name, method, and URL change.\r\n\r\n---\r\n\r\n## Installation\r\n\r\nInstall the package using npm:\r\n\r\n```bash\r\nnpm install @ahsan-iftikhar-114/api-toolkit-react-query\r\n```\r\n\r\n### Requirements\r\n\r\n* React 18 or newer\r\n* TanStack Query 5 or newer\r\n* Axios 1 or newer\r\n* TypeScript 5 or newer recommended\r\n\r\n---\r\n\r\n## Basic Setup\r\n\r\nThere are three main steps to start using the package.\r\n\r\n### 1. Configure the API\r\n\r\nConfigure your backend API URL and, if required, your authentication token.\r\n\r\nThe configuration is applied globally so that individual API definitions do not need to repeat the same settings.\r\n\r\nYou can configure:\r\n\r\n* Base API URL\r\n* Request timeout\r\n* Global headers\r\n* Authentication token\r\n\r\n---\r\n\r\n### 2. Configure TanStack Query\r\n\r\nThe package uses TanStack Query for managing server data.\r\n\r\nYour React application needs a `QueryClient` and `QueryClientProvider`.\r\n\r\nYou can create a QueryClient using the package helper:\r\n\r\n```text\r\ncreateApiQueryClient()\r\n```\r\n\r\nor use your own TanStack Query `QueryClient`.\r\n\r\nThe package does not create or force a global QueryClient.\r\n\r\n---\r\n\r\n### 3. Create APIs\r\n\r\nCreate your APIs using:\r\n\r\n```text\r\ncreateApi(name, method, url)\r\n```\r\n\r\nThis is the main API creation function of the package.\r\n\r\n---\r\n\r\n# HTTP Methods\r\n\r\n## GET\r\n\r\nGET requests are used to retrieve data.\r\n\r\nExamples:\r\n\r\n* Get users\r\n* Get employees\r\n* Get products\r\n* Get orders\r\n* Get reports\r\n\r\nWhen `GET` is used with `createApi()`, the package creates a TanStack Query.\r\n\r\nThe query provides access to:\r\n\r\n* Response data\r\n* Loading state\r\n* Error state\r\n* Fetching state\r\n* Refetching\r\n* Cached data\r\n\r\n---\r\n\r\n## POST\r\n\r\nPOST requests are generally used to create new data.\r\n\r\nExamples:\r\n\r\n* Create user\r\n* Create employee\r\n* Create product\r\n* Submit a form\r\n\r\nWhen `POST` is used, the package creates a TanStack Query mutation.\r\n\r\n---\r\n\r\n## PUT\r\n\r\nPUT requests are used to update existing data.\r\n\r\nExamples:\r\n\r\n* Update user\r\n* Update employee\r\n* Update product\r\n\r\nPUT APIs are handled as mutations.\r\n\r\n---\r\n\r\n## PATCH\r\n\r\nPATCH requests are used to partially update existing data.\r\n\r\nExamples:\r\n\r\n* Change user status\r\n* Update employee status\r\n* Change order status\r\n\r\nPATCH APIs are handled as mutations.\r\n\r\n---\r\n\r\n## DELETE\r\n\r\nDELETE requests are used to remove data.\r\n\r\nExamples:\r\n\r\n* Delete user\r\n* Delete employee\r\n* Delete product\r\n\r\nDELETE APIs are handled as mutations.\r\n\r\n---\r\n\r\n# Request Data\r\n\r\nPOST, PUT, PATCH and DELETE requests can send data to the backend.\r\n\r\nFor example, an employee API may need:\r\n\r\n* Name\r\n* Email\r\n* Department\r\n* Position\r\n\r\nThe package supports request payloads along with query parameters, headers and additional Axios configuration.\r\n\r\n---\r\n\r\n# Query Parameters\r\n\r\nGET requests can include query parameters for:\r\n\r\n* Search\r\n* Pagination\r\n* Filtering\r\n* Sorting\r\n* Page size\r\n* Status\r\n\r\nFor example:\r\n\r\n```text\r\n/users?page=1&search=ahsan\r\n```\r\n\r\nQuery parameters are also included in the query key, allowing TanStack Query to manage different parameter combinations separately.\r\n\r\n---\r\n\r\n# Authentication\r\n\r\nThe package supports Bearer token authentication.\r\n\r\nYou can configure either:\r\n\r\n* A static token\r\n* A function that returns the current token\r\n\r\nThis allows applications to keep authentication configuration in one place instead of manually adding the token to every request.\r\n\r\nThe backend remains responsible for authentication and authorization.\r\n\r\n---\r\n\r\n# API Base URL\r\n\r\nA global base URL can be configured for the application.\r\n\r\nFor example:\r\n\r\n```text\r\nhttps://api.example.com\r\n```\r\n\r\nIndividual APIs can then use relative paths:\r\n\r\n```text\r\n/users\r\n/employees\r\n/products\r\n/orders\r\n```\r\n\r\nThis keeps API definitions short and makes it easier to change the backend URL later.\r\n\r\n---\r\n\r\n# Loading and Request States\r\n\r\nTanStack Query provides request state information for GET requests and mutation state information for POST, PUT, PATCH and DELETE requests.\r\n\r\nThis can be used to display:\r\n\r\n* Loading indicators\r\n* Saving indicators\r\n* Delete progress\r\n* Error messages\r\n* Refreshing states\r\n\r\nThe package does not require developers to create separate loading state variables for every API request.\r\n\r\n---\r\n\r\n# Error Handling\r\n\r\nThe package normalizes API errors into a consistent `ApiError` structure.\r\n\r\nThe error can include:\r\n\r\n* Message\r\n* HTTP status\r\n* Status text\r\n* Response data\r\n* Validation errors\r\n* Original Axios error\r\n\r\nThis provides a consistent way to handle API errors throughout the application.\r\n\r\n---\r\n\r\n# Caching\r\n\r\nGET requests use TanStack Query's caching system.\r\n\r\nPreviously fetched data can be stored in the query cache according to the configured TanStack Query settings.\r\n\r\nCaching can reduce unnecessary API requests and improve the responsiveness of an application.\r\n\r\n---\r\n\r\n# Refetching\r\n\r\nTanStack Query provides refetching functionality for keeping server data up to date.\r\n\r\nDepending on your configuration, queries can be refetched when:\r\n\r\n* A user manually refreshes data\r\n* Data becomes stale\r\n* The application reconnects\r\n* A component mounts\r\n* A configured interval is reached\r\n\r\n---\r\n\r\n# Cache Invalidation\r\n\r\nWhen data is created, updated or deleted, previously cached data may become outdated.\r\n\r\nThe package provides cache utilities for invalidating queries.\r\n\r\nAvailable utilities include:\r\n\r\n```text\r\ninvalidateApi()\r\ninvalidateApis()\r\ninvalidateAllApis()\r\n```\r\n\r\nYou can use these after mutations to tell TanStack Query that related data should be refreshed.\r\n\r\n---\r\n\r\n# Request Cancellation\r\n\r\nThe package supports request cancellation through `AbortSignal`.\r\n\r\nThis is useful when a request is no longer required, such as when a user changes a search request before the previous request has completed.\r\n\r\nThe package also provides:\r\n\r\n```text\r\ncancelApi()\r\n```\r\n\r\nfor cancelling queries associated with an API.\r\n\r\n---\r\n\r\n# React Query Options\r\n\r\nThe package supports standard TanStack Query options.\r\n\r\nThese include:\r\n\r\n* `staleTime`\r\n* `gcTime`\r\n* `enabled`\r\n* `retry`\r\n* `retryDelay`\r\n* `refetchInterval`\r\n* `refetchOnWindowFocus`\r\n* `refetchOnReconnect`\r\n* `refetchOnMount`\r\n* `initialData`\r\n* `placeholderData`\r\n* `select`\r\n\r\nThis allows the basic API creation system to remain simple while still providing access to TanStack Query's configuration options.\r\n\r\n---\r\n\r\n# Data Selection\r\n\r\nThe `select` option can be used when the component only needs a specific part or transformed version of the API response.\r\n\r\nFor example, an API may return a complete list of users while a component only needs the number of users.\r\n\r\nTanStack Query's `select` functionality can be used for this transformation without changing the original cached data.\r\n\r\n---\r\n\r\n# Axios Configuration\r\n\r\nThe package uses Axios for HTTP requests.\r\n\r\nIn addition to the global configuration, individual requests can use:\r\n\r\n* Request-specific headers\r\n* Query parameters\r\n* Request data\r\n* Axios request configuration\r\n* Request cancellation\r\n\r\nThis provides additional control when a specific API needs different settings.\r\n\r\n---\r\n\r\n# TypeScript\r\n\r\nThe package supports TypeScript generics for API responses, request data and selected data.\r\n\r\nThis provides type checking and editor support when working with API data.\r\n\r\nTypeScript is recommended for larger React applications.\r\n\r\n---\r\n\r\n# Query Client\r\n\r\nThe package provides:\r\n\r\n```text\r\ncreateApiQueryClient()\r\n```\r\n\r\nas a helper for creating a TanStack Query `QueryClient`.\r\n\r\nYou can also create and configure your own `QueryClient`.\r\n\r\nThe package does not maintain a hidden global QueryClient. This allows the application to control its own QueryClient and cache lifecycle.\r\n\r\n---\r\n\r\n# Complete API Flow\r\n\r\nThe package follows this general flow:\r\n\r\n```text\r\ncreateApi(name, method, url)\r\n              |\r\n              v\r\n        API Definition\r\n              |\r\n              v\r\n           Axios\r\n              |\r\n              v\r\n        Backend API\r\n              |\r\n              v\r\n      TanStack Query\r\n              |\r\n              v\r\n   Data / Cache / Loading\r\n   Errors / Refetching\r\n   Mutations / Invalidation\r\n```\r\n\r\nThe developer mainly works with `createApi()` while Axios and TanStack Query handle the underlying API and server-state functionality.\r\n\r\n---\r\n\r\n# Example Use Cases\r\n\r\nThe same generic API function can be used in different types of applications.\r\n\r\nFor an HRMS:\r\n\r\n```text\r\nEmployees\r\nAttendance\r\nLeave\r\nPayroll\r\nPerformance\r\nRequests\r\nNotifications\r\n```\r\n\r\nFor a CRM:\r\n\r\n```text\r\nLeads\r\nContacts\r\nCompanies\r\nOpportunities\r\nDeals\r\nCustomers\r\n```\r\n\r\nFor an e-commerce application:\r\n\r\n```text\r\nProducts\r\nCategories\r\nOrders\r\nCustomers\r\nPayments\r\n```\r\n\r\nThe API creation pattern remains the same.\r\n\r\n---\r\n\r\n# Supported Methods\r\n\r\n| Method | Type     | Purpose               |\r\n| ------ | -------- | --------------------- |\r\n| GET    | Query    | Retrieve data         |\r\n| POST   | Mutation | Create data           |\r\n| PUT    | Mutation | Update data           |\r\n| PATCH  | Mutation | Partially update data |\r\n| DELETE | Mutation | Delete data           |\r\n\r\n---\r\n\r\n# Backend Compatibility\r\n\r\nThe package can be used with any backend that provides a compatible HTTP API.\r\n\r\nExamples include:\r\n\r\n* Laravel\r\n* PHP\r\n* Node.js\r\n* Express\r\n* NestJS\r\n* .NET\r\n* ASP.NET\r\n* Django\r\n* FastAPI\r\n* Spring Boot\r\n* Other REST API backends\r\n\r\nThe package is responsible for the React API layer. Backend authentication, authorization, validation and business logic remain the responsibility of the backend application.\r\n\r\n---\r\n\r\n# Security\r\n\r\nThe package supports authentication tokens but does not provide an authentication system.\r\n\r\nYour application and backend are responsible for:\r\n\r\n* Login\r\n* Registration\r\n* Token generation\r\n* Token refresh\r\n* Token expiration\r\n* Roles\r\n* Permissions\r\n* Authorization\r\n\r\nDo not expose private server credentials or secrets in a React application.\r\n\r\n---\r\n\r\n# Technology\r\n\r\nThis package uses:\r\n\r\n* React\r\n* TypeScript\r\n* Axios\r\n* TanStack Query v5\r\n\r\n---\r\n\r\n# Package Structure\r\n\r\nThe package separates its main responsibilities into:\r\n\r\n```text\r\nConfiguration\r\n     |\r\n     v\r\nAxios\r\n     |\r\n     v\r\nAPI Request\r\n     |\r\n     v\r\nTanStack Query\r\n     |\r\n     v\r\nReact Application\r\n```\r\n\r\nThis keeps API communication and server-state management reusable across the application.\r\n\r\n---\r\n\r\n# Main API\r\n\r\nThe main public function is:\r\n\r\n```text\r\ncreateApi(name, method, url)\r\n```\r\n\r\nAdditional public utilities include:\r\n\r\n```text\r\nconfigureApi()\r\ncreateApiQueryClient()\r\ninvalidateApi()\r\ninvalidateApis()\r\ninvalidateAllApis()\r\ncancelApi()\r\n```\r\n\r\nThe package also provides TypeScript types for API configuration, requests, responses, errors and React Query options.\r\n\r\n---\r\n\r\n# Keywords\r\n\r\nReact API toolkit, React API client, React Query API, TanStack Query API, Axios React Query, Axios API client, React API hooks, React Query hooks, React mutation hooks, TypeScript API client, React REST API client, API caching, React Query caching, API cache invalidation, Axios TypeScript, TanStack Query TypeScript, React API management, generic React API client, reusable React API hooks, API request management, React server state management.\r\n\r\n---\r\n\r\n# License\r\n\r\nThis package is released under the MIT License.\r\n\r\nSee the `LICENSE` file for complete license information.\r\n\r\n---\r\n\r\n# Author\r\n\r\nAhsan Iftikhar\r\n","readmeFilename":"README.md"}