Skip to content

Latest commit

 

History

History

api-client

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

@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