The [Parameter API](https://docs.vect.io/Parameter-API-14dd170381708091846ce750b38078db) provides access to selected files through Shares.
npm install @vect.io/api.fetch.parameter.client.binding.nodeThe Parameter API provides access to selected files through Shares.
Reading is secure, fault-tolerant, and cached - ensured by RFC compliant interfaces.
We recommend reading the Parameter API Docs.
``sh`
npm install @vect.io/api.fetch.parameter.client.binding.node
`typescript`
import Client from '@vect.io/api.fetch.parameter.client.binding.node'
const client = new Client({ repository: 'acme-com/acme-com-2024v1', shareName: 'public' });
await client.getFile({ path: 'example.json' });
#### Configuring requests
Requests can be configured by passing gotOptions, both per-client (through the constructor) and per-request (through getFile).
For secure requests, you can pass signingGotOptions to modify the request to the Vect signing service.
For reference see got options documentation.
##### Throwing on unsuccessful requests
To prevent throwing on unsuccessful requests (not 2xx/3xx), you can pass throwHttpErrors: false.
#### RFC-compliant caching
The client uses an RFC-compliant caching interface to cache responses.
This is implemented using the got library, which provides a caching layer.
The client also implements stale-while-revalidate behavior using a max-stale cache control directive.max-stale
This is enabled by default, but can be overriden by passing a cache-control header that doesn't contain the directive.
- The Client uses got under the hood to make requests. You can also use plain curl if you prefer:`
sh`
curl 'https://file.parameter.fetch.api.vect.io/v1/acme-com/acme-com-2024v1/live/shares/public/example.json'
- This package is ESM only, in order to import from CommonJS use require` in a supporting node version
---
Copyrighted by Vect.