@securityscorecard/sdk
TypeScript icon, indicating that this package has built-in type declarations

0.8.0 • Public • Published

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));

Readme

Keywords

none

Package Sidebar

Install

npm i @securityscorecard/sdk

Weekly Downloads

2

Version

0.8.0

License

MIT

Unpacked Size

164 kB

Total Files

81

Last publish

Collaborators

  • securityscorecard-npmbot
  • beneidel
  • cristiandley