{"id":24678733,"url":"https://github.com/contrast-security-oss/contrast-sdk-javascript","last_synced_at":"2025-07-27T03:33:57.601Z","repository":{"id":33961094,"uuid":"159548492","full_name":"Contrast-Security-OSS/contrast-sdk-javascript","owner":"Contrast-Security-OSS","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-03T21:22:31.000Z","size":157,"stargazers_count":1,"open_issues_count":3,"forks_count":1,"subscribers_count":31,"default_branch":"main","last_synced_at":"2025-07-18T10:53:31.538Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Contrast-Security-OSS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-11-28T18:43:29.000Z","updated_at":"2025-04-03T21:22:35.000Z","dependencies_parsed_at":"2025-03-06T18:30:08.962Z","dependency_job_id":"edf30d0e-3894-445d-9887-7cc948203398","html_url":"https://github.com/Contrast-Security-OSS/contrast-sdk-javascript","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Contrast-Security-OSS/contrast-sdk-javascript","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Contrast-Security-OSS%2Fcontrast-sdk-javascript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Contrast-Security-OSS%2Fcontrast-sdk-javascript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Contrast-Security-OSS%2Fcontrast-sdk-javascript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Contrast-Security-OSS%2Fcontrast-sdk-javascript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Contrast-Security-OSS","download_url":"https://codeload.github.com/Contrast-Security-OSS/contrast-sdk-javascript/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Contrast-Security-OSS%2Fcontrast-sdk-javascript/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267294179,"owners_count":24065343,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-27T02:00:11.917Z","response_time":82,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-26T13:18:05.081Z","updated_at":"2025-07-27T03:33:57.497Z","avatar_url":"https://github.com/Contrast-Security-OSS.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Install\nThe Contrast Api module is available to install via *npm*.\n```commandline\n    npm install contrast-sdk --save\n```\n\n### Sample usage\nThe SDK offers a majority of our public APIs through an instance of the ContrastSdk.\nAny method of the SDK that interacts with our API returns a promise.\n\n\u003e **Note:** The Contrast URL is optional and defaults to https://app.contrastsecurity.com/Contrast/api\n\n```javascript\n    var ContrastSdk = require('contrast-sdk');    \n    var contrastSdk = new ContrastSdk('username','api_key','service_key','teamserver_url');\n```\n\nAn example of getting an application:\n```javascript\n    var orgUuid='organization_uuid';\n    contrastSdk.getApplication(orgUuid, 'an_app_id').then(function(response){\n        console.log(response.application.name);\n    });\n```\n\nIn some cases, you may want to filter applications, servers, traces or libraries. Any endpoint that involves filtering can use the appropriate filter object.\n\nThese methods are easily identifiable on the ContrastSdk object by looking at any methods that include the phrase `filter`.\n\n```javascript\n    var filter = {};\n    filter.apps = ['appId1', 'appId2'];\n    contrastSdk.filterLibraries(orgUuid, filter).then(function(response){\n        response.libraries.forEach(function(library){\n            console.log(library.file_name + ' : ' + library.grade);\n        });\n    });\n```\n\n### Developing\nUse *npm* to install the projects dependencies:\n\n```commandline\n    npm install\n    npm install -g mocha\n```\n\nTo run the tests, create a file in the `/tests` directory called *config.json* with TeamServer information. An example test configuration can be seen in `tests/config.json.example`.\n\nThen run tests with mocha:\n\n```commandline\n    npm run test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontrast-security-oss%2Fcontrast-sdk-javascript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcontrast-security-oss%2Fcontrast-sdk-javascript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontrast-security-oss%2Fcontrast-sdk-javascript/lists"}