Builton offers a platform as a service that digitizes core business functions and optimizes resource allocation with baked-in machine learning capabilities. This SDK gives you a machine-to-machine access to our platform's building blocks and will help you implement its API in a Javascript environment. Get instant access to modules like Payments, Messaging Tools, User Management, Webhooks, Resource Allocation and more.
If you are looking for a client SDK, take a look at our Javascript SDK
- A Builton API Key
- A Builton Service Account Key
From npm
npm install @builton/node-sdk
new Builton({ apiKey, bearerToken })
Initialises a new instance of Builton
configured with your application apiKey
and a bearerToken
.
The bearerToken
is the service account key.
- apiKey {String}: Your attributed Builton API Key.
- bearerToken {String}: Your service account key.
Using a callback:
builton.orders.get({ size: 5 }, function(err, page) {
const firstOrder = page.current[0];
firstOrder.update({ delivery_status: 'DONE' });
});
Using promises:
builton.orders.get({ size: 5 }).then((page) => {
const firstOrder = page.current[0];
firstOrder.update({ delivery_status: 'DONE' });
});
Using async/await:
// This needs to be within in an `async` function
const page = await builton.orders.get({ size: 5 });
const firstOrder = page.current[0];
firstOrder.update({ delivery_status: 'DONE' });
builton.products.update(':productId:', {
name: 'New name'
});
The set
method allows you to create an object without fetching it from the api. I can be useful when working with stored data for example.
const product = builton.products.set(':productId:');
product.update({
name: 'New name'
});
With multiple payment methods:
const paymentMethods = builton.paymentMethods.set([':paymentMethodId1:', ':paymentMethodId2:']);
paymentMethods[0].update({
token: ':StripeTokenId:'
});
With full props:
const paymentMethod = builton.paymentMethods.set({<paymentMethodJsonObject>});
paymentMethod.update({
token: ':StripeTokenId:'
});
If you have found a bug or if you have a feature request, please report them to this repository's issues section.
This project is licensed under the MIT license. See the LICENSE file for more info.