0.1.0-alpha.18 • Published 2 years ago
sandbar v0.1.0-alpha.18
sandbar-js
node / javascript / typescript library for sandbar
Basic Usage Example
First, add this library to your project:
$ npm add sandbar
Then, use it in a file somewhere:
import * as sandbar from "sandbar";
async function foo() {
// or "mycompany" for prod
const client = new sandbar.Client({ subdomain: "mycompany.sandbox" });
const submitResult = await client.submitEvents([
{
/* your entity / account / transaction / etc here */
},
{
/* multiple events are supported */
},
]);
// pretty-print the API call result as JSON to the console
console.log(JSON.stringify(submitResult, undefined, 2));
}
All client actions return a promise. If you don't like using await
, you can
also consume the promie via the .then()
callback.
client
.submitEvents([])
.then((submitResult) =>
console.log(JSON.stringify(submitResult, undefined, 2))
);
Detailed Example
This repo includes a more detailed example as a package. The example package includes a README as well.
0.1.0-alpha.16
2 years ago
0.1.0-alpha.18
2 years ago
0.1.0-alpha.17
2 years ago
0.1.0-alpha.10
2 years ago
0.1.0-alpha.12
2 years ago
0.1.0-alpha.11
2 years ago
0.1.0-alpha.14
2 years ago
0.1.0-alpha.13
2 years ago
0.1.0-alpha.15
2 years ago
0.1.0-alpha.9
2 years ago
0.1.0-alpha.8
2 years ago
0.1.0-alpha.7
2 years ago
0.1.0-alpha.6
2 years ago
0.1.0-alpha.5
2 years ago
0.1.0-alpha.4
2 years ago
0.1.0-alpha.3
2 years ago
0.1.0-alpha.1
2 years ago