The Parameter API provides access to selected files through Shares. Reading is secure, fault-tolerant, and cached - ensured by RFC compliant interfaces.

import Client from '@vect.io/api.fetch.parameter.client.binding.web'
const client = new Client({ shareName: 'frontend', repository: 'acme-com/acme-com-2024v1' });
await client.getFile({ path: 'images.json' });

<aside> 📚

For client libraries, jump to Clients

</aside>

Shares

Shares configure the API behavior for selected files, supporting different use cases for specific files. For example a Share for frontend that your customers can access, a development Share without cache for faster refresh, and a backend Share for internal use.

Shares can be managed through the Parameter Shares page on your repository.

Security

Shares can be secured using API keys, requiring signing to access the resource. Signing is transparently performed by the API when passed an API key. Configure the Share config with protected: true to enable this behavior.

new Client({
	shareName: 'backend',
	auth: 'vect_2UeVewURupNV45zc4aDGmLjt9gDX1Ynqhv9z6z3gqCe833',
	repository: 'acme-com/acme-com-2024v1'
});

Caching and Recovery

Files are served with caching, enabling error recovery and preloading, using RFC compliant headers.

Our client libraries cache and provide this behavior by default, respecting the RFC.

Server-side client libraries allow caching on custom caches, including FS and external databases.

Headers can be configured for origin through Share config on Vect, or on the client side.

  1. Control cache time by setting the max-age ****directive. Default value is 1 hour.
  2. Ensure a cached value is always available by setting the stale-while-revalidate directive. Default value is 1 day.
  3. Recover from errors by setting the stale-if-error directive. Default is 2 days.

CDN