A TypeScript client library for interacting with the Global Fishing Watch API.
- Authentication management (login, logout, token refresh)
- HTTP request handling with automatic token refresh
- File downloads
- Advanced search query building
- Configurable request tracks thinning
- Fetch request options
yarn add @globalfishingwatch/api-client
// Basic GET request
const data = await GFWAPI.fetch('/endpoint')
// POST request with body
const response = await GFWAPI.fetch('/endpoint', {
method: 'POST',
body: { key: 'value' },
})
// Download file
await GFWAPI.download('download-url', 'filename.pdf')
The library supports the following environment variables:
API_GATEWAY
API_GATEWAY_VERSION
MIT