Loading…
Loading…
API reference, SDK quickstarts, and integration guides for Bachao.AI's cybersecurity platform.
Add runtime protection to your Node.js app in under 2 minutes.
npm install @bachao/rasp-nodeimport express from "express";
import { bachaoRasp } from "@bachao/rasp-node";
const app = express();
app.use(bachaoRasp({
apiKey: process.env.BACHAO_RASP_KEY!,
appName: "my-api",
mode: "monitor", // start in monitor mode, switch to "block" from dashboard
}));
app.listen(3000);import Fastify from "fastify";
import { bachaoRaspFastify } from "@bachao/rasp-node/fastify";
const app = Fastify();
app.register(bachaoRaspFastify, {
apiKey: process.env.BACHAO_RASP_KEY!,
appName: "my-api",
});import { Module } from "@nestjs/common";
import { BachaoRaspModule } from "@bachao/rasp-node/nestjs";
@Module({
imports: [BachaoRaspModule.forRoot({
apiKey: process.env.BACHAO_RASP_KEY!,
appName: "my-api",
})],
})
export class AppModule {}How authentication works between the dashboard, SDK, and API.
POST /api/rasp/setup/generate-keyx-rasp-key header)x-rasp-key header# Generate setup token from dashboard
curl -X POST https://www.bachao.ai/api/rasp/setup/generate-key \
-H "Cookie: bachao-session=YOUR_SESSION" \
-H "Content-Type: application/json"
# Response:
# { "success": true, "setupToken": "eyJ..." }All public API endpoints available for integration.
| Method | Endpoint | Auth | Description |
|---|---|---|---|
| POST | /api/rasp/register | Setup token | Register new RASP agent |
| POST | /api/rasp/heartbeat | API key | Agent health check + rule sync |
| POST | /api/rasp/events | API key | Report security events (batch) |
| GET | /api/rasp/rules | API key | Fetch protection rules |
| POST | /api/rasp/rules | Session | Create protection rule |
| GET | /api/rasp/agents | Session | List registered agents |
| GET | /api/rasp/stats | Session | Dashboard statistics |
| POST | /api/scans/book | Session | Book a VAPT scan |
| GET | /api/scans | Session | List your scans |
| GET | /api/reports/{id} | Session | Fetch scan report |
Receive real-time notifications when events occur in your account.
{
"event": "scan.completed",
"scanId": "clx...",
"scanUrl": "https://example.com",
"scanType": "pentest",
"riskScore": 72,
"findingsCount": 23,
"criticalCount": 2,
"timestamp": "2026-03-23T10:00:00Z"
}Trigger security scans automatically from your deployment pipeline.
# .github/workflows/security-scan.yml
name: Bachao.AI Security Scan
on: [push]
jobs:
scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Trigger VAPT Scan
run: |
curl -X POST https://www.bachao.ai/api/scans/book \
-H "Cookie: bachao-session=${{secrets.BACHAO_SESSION}}" \
-H "Content-Type: application/json" \
-d '{"scanUrl":"https://staging.example.com","scanType":"pentest"}'Official client libraries and platform support.
Node.js RASP SDK
npmServer-side RASP agents
Coming SoonAvailable for all products
AvailableTalk to our engineering team. We'll help you get set up in under 30 minutes.
Talk to Engineering