1.0.1 • Published 1 year ago

pinejs-client-fetch v1.0.1

Weekly downloads
2
License
Apache-2.0
Repository
github
Last release
1 year ago

pinejs-client-fetch

This module provides the programming interface for the pinejs API using fetch.

Usage

import PineFetch from 'pinejs-client-fetch';

const pine = new PineClientFetch(
	{ apiPrefix: 'https://api.balena-cloud.com/v5/' },
	{ fetch: fetch },
);

const result = await pine.get({
	resource: 'application',
	options: {
		$top: 1,
		$select: 'app_name',
	},
})

You can also define extra init options for the fetch calls in the passthrough property:

await pine.get({
    resource: 'application',
    passthrough: {
        headers: {
            authorization: "Bearer " + myBearerToken,
        }
    }
});