CrowdStrike Falcon API JS library for the browser and Node
falconjs is an open source project, not a CrowdStrike product. As such it carries no formal support, expressed or implied.
npm install crowdstrike-falcon
With falconjs, there are two ways to call CrowdStrike API service collections. You can use the FalconClient object, which has always been available, or you can use the new Falcon object, which behaves like the API Harness, or UberClass, from FalconPy.
import { FalconClient, FalconErrorExplain } from "crowdstrike-falcon";
const client = new FalconClient({
cloud: "us-1",
clientId: "",
clientSecret: "",
});
await client.sensorDownload
.getSensorInstallersCCIDByQuery()
.catch(async function (err) {
alert("Could not fetch CCID: " + (await FalconErrorExplain(err)));
})
.then((value) => {
console.log("my CCID: ", value);
});
when using request body properties:
const body = { ids: ["123", "456", "789"]}
try {
detDetails = await falcon.command("GetDetectSummaries", body)
return detDetails
} catch (error) {
console.log(error)
return
}
when using query params:
const params = { filter: "score:<=75"}
const args = {"getAssessmentsByScoreV1", params }
try {
ztaDetails = await falcon.command(args)
return ztaDetails
} catch(error) {
console.log(error)
return
}