@boomi/embedkit-sdk
v1.2.19
Published
Boomi EmbedKit SDK
Downloads
270
Readme
Boomi EmbedKit SDK
This SDK provides convenient access to the Boomi Platofrm API from applications written in server-side JavaScript.
Installation
Install the package with:
npm install @boomi/embedkit-sdk
or
yarn add @boomi/embedkit-sdkUsage
The package needs to be configured with your Boomi Platform AccountID, API User Name, and API Token. Please visit the Boomi API Docs for more information.
try {
const accountId = process.env.API_ACCOUNT_ID!;
boomi = new Boomi({
BASE: `https://api.boomi.com/api/rest/v1/${accountId}`,
USERNAME: process.env.API_USERNAME,
PASSWORD: process.env.API_TOKEN,
WITH_CREDENTIALS: true, // Ensure credentials are included in requests
CREDENTIALS: 'include', // set to include
OVERRIDE_ACCOUNT: false, // Set to true to access data from child accounts
OVERRIDE_ACCOUNT_ID: process.env.API_AUTH_USER, // Example: Auth user BOOMI_ACCOUNT_ID
});
} catch (error) {
console.error('Error:', error);
}To call and endpoint using the above:
try {
const expression: AccountGroupExpression = {
operator: AccountGroupSimpleExpression.operator.EQUALS,
property: AccountGroupSimpleExpression.property.NAME,
argument: ['Sample Account Group Name'],
};
const requestBody: AccountGroupQueryConfig = {
QueryFilter: { expression },
};
const response = await boomi.accountGroup.queryAccountGroup(requestBody);
} catch (error) {
console.error('Error:', error);
}