@securityscorecard/sdk
v0.8.0
Published
SecurityScorecard Public SDK
Downloads
6
Keywords
Readme
SDK
Getting Started
const { SSC } = require('@securitysorecard/sdk');
const ssc = SSC({ token: 'YOUR_API_ROKEN', host: '', timeout: ''});
Installation Resources
// install the app in your account
ssc.apps.install({url: 'app_manifest_url'})
.then(appInfo => console.log('App succesfully installed', appInfo));
// update app installation data
ssc.apps.updateInstallationData('installation_code', [{'secret_1': 'value'}])
.then(completeInstallationResponse => console.log('Installation data successfully updated', completeInstallationResponse));
Validation Resources
// validate the app manifest
ssc.apps.validate({url: 'app_manifest_url'})
.then(validationResponse => {
if (validationResponse.success === true) {
console.log('Manifest validation success')
} else {
console.log('Manifest validation failed with message:', validationResponse.message);
}
});
Signal Resources
// send signals
ssc.apps.sendSignals('app_namespace.signal_type', [{...signal1}, {...signal2}])
.then(signalsResponse => console.log('Signals emmited, check the response for failures', signalsResponse));
Subscriptions Resources
// send signals
ssc.subscriptions.owned().then(subscriptions => console.log('List of owned subscriptions', signalsResponse));
Events Resources
// send signals
ssc.events.trigger(({
ruleId: 'unique_id',
type: 'scorecard.changed',
event: <EVENT_DETAILS>,
})).then(({ received }) => console.log('Rule trial', received));