Skip to content

Latest commit

 

History

History
45 lines (31 loc) · 957 Bytes

README.md

File metadata and controls

45 lines (31 loc) · 957 Bytes

@globalfishingwatch/api-client

A TypeScript client library for interacting with the Global Fishing Watch API.

Features

  • 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

Installation

yarn add @globalfishingwatch/api-client

Usage

// 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')

Environment Variables

The library supports the following environment variables:

  • API_GATEWAY
  • API_GATEWAY_VERSION

License

MIT