SDKs
Official client libraries handle authentication, retries, and polling so you can integrate CodeSec in a few lines. Pick your language to get started.
JavaScript / TypeScript
Node 18+ · ESM & CJSInstall
npm install @codesec/sdkUsage
import { CodeSec } from class="tok-str">"@codesec/sdk";
const client = new CodeSec({
apiKey: process.env.CODESEC_API_KEY,
});
const scan = await client.scan({
target: class="tok-str">"https://example.com",
});
// Poll until the scan finishes
const results = await client.scans.waitForResults(scan.id);
console.log(results.score, results.findings);Python
Python 3.9+Install
pip install codesecUsage
from codesec import CodeSec
client = CodeSec(api_key=class="tok-str">"YOUR_API_KEY")
scan = client.scan(class="tok-str">"https://example.com", scan_type=class="tok-str">"full")
results = client.scans.wait_for_results(scan.id)
print(results.score, results.findings)cURL
Any environmentInstall
# No install required — just curlUsage
curl https://api.codesec.me/v1/scans \
-H "Authorization: Bearer YOUR_API_KEY"Looking for another language? The API is plain REST — see the documentation or import the OpenAPI spec into your generator of choice.