pinejs-client-fetch

This module provides the nodejs interface for the pinejs API using request.

Usage no npm install needed!

<script type="module">
  import pinejsClientFetch from 'https://cdn.skypack.dev/pinejs-client-fetch';
</script>

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