Skip to content

Latest commit

 

History

History
39 lines (31 loc) · 835 Bytes

File metadata and controls

39 lines (31 loc) · 835 Bytes

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,
        }
    }
});