Client
The Client component focuses on optimizing the developer experience by offering various implementation options to suit different use cases and performance requirements. The three main scenarios are:
Backend Usage
a. Microservice:
Developers can run the QRY Client as a microservice alongside their application. They would only need to redirect their API calls to the local endpoint, thus minimizing the required code changes.
b. SDK:
For high-performance applications, the QRY Client SDK can be integrated directly into the application code. This eliminates the need to call an external microservice, reducing latency and improving efficiency.
Frontend Usage (In-browser)
Some applications make API calls directly from the users' browsers, leading to lower response times and reducing the load on the application's backend. QRY can handle this situation by using a request interceptor, which attaches a temporary API key to the client's requests. This interceptor also handles the endpoint selection automatically.
The temporary API key is linked to the application's subscription and approved by the application's owner. In this case, the Providers' Gateways are instructed to accept temporary API keys for the application's users, ensuring a smooth user experience while efficiently managing API requests.