Finite State manages risk across your software supply chain so that you can minimize risk, ship confidently, and reduce attack surface. Finite State reduces software supply chain risk with end-to-end SBOM solutions for the connected world.
The cloud-based SaaS platform for SBOM and Product Security management enables you to:
Finite State's powerful GraphQL API gives you and your teams access to the incredibly rich data you have in the platform. These SDKs, tools, and examples help your team to connect to Finite State APIs quickly and easily.
This is a translation of the Python SDK to Typescript.
View the API Docs here.
npm install finite-state-sdk
Ensure your import statement is correct. If your package uses ES module syntax, this should work:
import {FiniteStateSDK} from 'finite-state-sdk';
However, if you're using CommonJS in your package, you may need:
import * as FiniteStateSDK from 'finite-state-sdk';
or
const FiniteStateSDK = require('finite-state-sdk');
For more information about Finite State's APIs, see: https://docs.finitestate.io.
Our teams are working to add additional programming language and package manager support for Finite State SDKs.
import { FiniteStateSDK } from "finite-state-sdk";
import { join } from "path";
const clientId = "PUT_HERE_CLIENT_ID";
const clientSecret = "PUT_HERE_CLIENT_SECRET";
const organizationContext = "PUT_HERE_ORGANIZATION_CONTEXT";
const client = new FiniteStateSDK({
clientId,
clientSecret,
organizationContext,
});
const runCreateNewAssetVersionAndUploadBinary = async () => {
const filePath = join(process.cwd(), "dist", "yourBinaryFile.bin");
const response = await client.createNewAssetVersionAndUploadBinary({
assetId: "2720805123",
version: "1",
filePath: filePath,
});
console.info(response);
};
const runCreateNewAssetVersionAndTestUploadResult = async () => {
const filePath = join(process.cwd(), "dist", "cyclonedx.sbom.json");
const response = await client.createNewAssetVersionAndUploadTestResults({
assetId: "2720805124",
version: "3",
filePath: filePath,
testType: "cyclonedx",
});
console.info(response);
};
const main = async () => {
await runCreateNewAssetVersionAndUploadBinary();
await runCreateNewAssetVersionAndTestUploadResult();
};
main();
Refer to our contribution guidelines
Licensed under MIT, see LICENSE
Please follow the steps described here