1
Install
2
Create a client
Optional configuration
| Option | Description | Default |
|---|---|---|
dataEndpoint | Base URL for the classic data API. | https://data-api.polymarket.com |
gammaEndpoint | Base URL for the gamma API. | https://gamma-api.polymarket.com |
fetch | Custom Fetch implementation (for SSR/tests). | globalThis.fetch |
Mocking in tests — pass a stubbed fetch that returns predefined payloads. All methods
pipe through the injected fetch before validation.
3
Verify connectivity
HttpError for API
failures and Error("Network error: …") for connectivity issues.4
Make your first requests