pinejs-client-fetch
v1.0.2
Published
This module provides the nodejs interface for the pinejs API using request.
Downloads
16,925
Readme
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,
}
}
});