Both client creation functions accept an optional configuration object as their last parameter. This object follows the Axios CreateAxiosDefaults interface, allowing you to customize the HTTP client behavior.
While the SDK doesn’t directly expose the Axios instance, you can configure interceptors through the options:
import axios from "axios";const customInstance = axios.create({ baseURL: "https://api.paynow.gg"});// Add request interceptorcustomInstance.interceptors.request.use((config) => { console.log("Making request to:", config.url); return config;});// Note: For advanced use cases, you may need to create a custom wrapper
The SDK exports TypeScript types for all API schemas:
import type { StorefrontSchemas, ManagementSchemas, WebhookPayloadSchemas} from "@paynow-gg/typescript-sdk";// Access specific schema typestype Store = StorefrontSchemas["Store"];type Order = ManagementSchemas["Order"];type OrderCreatedWebhook = WebhookPayloadSchemas["Order_Created"];
These types are automatically generated from the PayNow OpenAPI specifications, ensuring they’re always accurate and up-to-date.