ThirstieClient provides a service layer for using the Thirstie ECommerce API which can be imported as a CommonJS or ES module.
npm install @thirstie/thirstieclient
- Node.js: v18+
You must have an Thirstie API Client Key (provided by your Thirstie representative)
to initialize ThirstieClient
. Optionally, you can also provide a Google API key to
enable location services using Google's Maps / Places API.
async function main (apiKey, mapsKey) {
const thirstieapp = new ThirstieClient({ apiKey, mapsKey });
const res = await thirstieapp.initSession();
console.log(res);
}
main();
Expected output:
{
application_name: '<your thirstie application name>',
session_uuid: '<session uuid>',
token: '<access jwt>',
token_type: 'Bearer',
user: null,
uuid: '<thirstie application uuid>'
}