forthres-scan
v1.0.7
Published
Official Forthres Scan SDK and CLI for the Forthres security platform
Maintainers
Readme
forthres
Official Forthres CLI and SDK for the Forthres security platform.
Install
npm install forthresProduction setup
Set the API base URL and your tenant key before using protected endpoints:
export FORTHRES_API_BASE_URL="https://api.forthres.ai"
export FORTHRES_API_KEY="hk_..."SDK
import { createForthresClient } from "forthres";
const client = createForthresClient({
baseUrl: "https://api.forthres.ai",
apiKey: process.env.FORTHRES_API_KEY,
});
const status = await client.getScannerStatus({ chain: "ethereum" });
const report = await client.runScan({
chain: "ethereum",
contractAddress: "0x1234567890abcdef1234567890abcdef12345678",
mode: "deep",
fork: "auto",
});API key management is also available from the SDK:
const keys = await client.listApiKeys();
const created = await client.createApiKey({ label: "ci-production" });
await client.revokeApiKey(created.id);CLI
npx forthres health --base-url https://api.forthres.ai
npx forthres status --chain ethereum --api-key hk_...
npx forthres scan 0x1234567890abcdef1234567890abcdef12345678 --chain ethereum --mode deep --api-key hk_...
npx forthres scan 0x1234567890abcdef1234567890abcdef12345678 --chain ethereum --mode deep --json --api-key hk_...
npx forthres keys list --api-key hk_...
npx forthres keys create --label ci-production --api-key hk_...
npx forthres keys revoke 2c1b9a1e-0000-0000-0000-000000000000 --api-key hk_...By default, scan prints short real-time terminal logs plus a final human summary. Use --json for newline-delimited machine-readable events.
Tenant bootstrap
For first provisioning, create a tenant from the admin API and store the returned apiKey securely:
curl -X POST https://api.forthres.ai/api/admin/tenants \
-H "content-type: application/json" \
-H "x-admin-token: $FORTHRES_ADMIN_TOKEN" \
-d '{"name":"Acme Security","slug":"acme-security","plan":"pro"}'After that, use the returned tenant key in the SDK, CLI, CI or scripts through FORTHRES_API_KEY.
