How it worksPricingDocsBlog
Appearance

// api reference

API Reference

SDK methods, REST endpoints, and webhook events. Everything is versioned under v1.

Public SDK key
pk_live_…

Used in the SDK — safe to include in client-side code

Secret API key
sk_live_…

Used for REST API calls — never expose in client code

// SDK

JavaScript SDK

Works in any web app or React Native project. Auto-captures all uncaught errors once initialized.

Installation

Script tag — Lovable, Bolt, Replit
<script
  src="https://cdn.eazipost.com/v1/sdk.js"
  data-key="pk_live_YOUR_KEY"
  async>
</script>
npm — Cursor, v0, Next.js
npm install @vybesec/sdk

# React Native / Expo
npm install @vybesec/react-native

Need a full setup guide with platform-specific instructions? See the Documentation page.

Quick start

Call init() once at the very root of your app — before anything renders. All error capture is automatic from that point.

import { init } from "@vybesec/sdk"

init({
  key:         "pk_live_YOUR_KEY",
  platform:    "cursor",      // personalizes your fix prompts
  environment: "production",
})

init(config)

Call once at app root

Initializes the SDK and begins automatic error capture. Must be called before your app renders.

Example
init({
  key:         "pk_live_YOUR_KEY",   // required
  platform:    "cursor",             // optional — tailors fix prompts
  environment: "production",         // optional — default: "production"
  sampleRate:  1.0,                  // optional — default: 1.0 (capture all)
})
ParameterTypeRequiredDescription
keystringYesYour public SDK key from the dashboard. Starts with pk_live_.
platform'lovable' | 'bolt' | 'replit' | 'v0' | 'base44' | 'emergent' | 'tempo' | 'webdraw' | 'wix-vibe' | 'hostinger-ai' | 'databutton' | 'firebase-studio' | 'youware' | 'heyboss' | 'rork' | 'rapidnative' | 'create-expo' | 'cursor' | 'windsurf' | 'trae' | 'kiro' | 'antigravity' | 'jetbrains-ai' | 'github-copilot' | 'augment-code' | 'amazon-q' | 'claude-code' | 'cline' | 'codex' | 'aider' | 'devin' | 'openhands' | 'continue' | 'roocode' | 'goose' | 'open-interpreter' | 'tabby' | 'cody' | 'junie' | 'jules' | 'ampcode' | 'nextjs' | 'react' | 'vue' | 'svelte' | 'sveltekit' | 'nuxt' | 'angular' | 'remix' | 'astro' | 'solid' | 'qwik' | 'gatsby' | 'vanilla' | 'react-native' | 'expo' | 'other'NoYour tool or framework. Personalizes fix prompt format. Defaults to "other".
environmentstringNoDefaults to "production". Set to "development" locally to avoid polluting your dashboard.
sampleRatenumberNo0–1. Default 1.0 (capture 100%). Use 0.5 to sample 50% at high event volume.

captureError(error, context?)

Manual capture

Manually send an error with optional key-value context. Use inside try/catch blocks when you want to attach extra information — like an order ID or user state — to the captured error.

Example
try {
  await submitOrder(cart)
} catch (err) {
  captureError(err, {
    userId:  currentUser.id,
    orderId: cart.id,
    total:   cart.total.toString(),
  })
}
ParameterTypeRequiredDescription
errorError | unknownYesThe error object to capture. Pass the raw error from your catch block.
contextRecord<string, string>NoKey-value pairs attached to this event. Values must be strings.

captureMessage(message, level?)

Custom events

Track meaningful events that aren't errors — a payment declining, a user hitting a limit, or a slow operation completing. These appear in your issues feed alongside errors.

Example
import { captureMessage } from "@vybesec/sdk"

// Warn when something degrades but doesn't crash
captureMessage("Stripe webhook timeout — retrying", "warning")

// Track unusual but non-critical paths
captureMessage("User exported 10,000+ rows", "info")
ParameterTypeRequiredDescription
messagestringYesThe message to record.
level'error' | 'warning' | 'info'NoSeverity level. Defaults to "info".

setUser(user)

User context

Link all subsequent errors to a specific user. Call this after login so your dashboard shows who was affected — not just how many users.

Example
import { setUser } from "@vybesec/sdk"

// After login
setUser({ id: user.id, username: user.displayName })

// After logout — clears user context
setUser(null)
ParameterTypeRequiredDescription
idstringYesYour internal user ID. Never use email addresses or other PII — just your database ID.
usernamestringNoOptional display name shown in the VybeSec dashboard.
// REST API

REST API

Server-side API for reading your project data, managing issues, and configuring alerts programmatically.

Base URL

https://api.vybesec.io/v1

All endpoints are versioned. The current version is v1. Breaking changes will be introduced under a new version, not in-place.

Authentication

All REST API requests require your secret API key as a Bearer token. Get yours from Dashboard → Settings → API keys.

Your sk_live_ key has full read/write access to your account. Never include it in client-side code, public repos, or environment variables that ship to the browser.

# Every request needs this header
Authorization: Bearer sk_live_YOUR_SECRET_KEY
Content-Type: application/json
Example request
curl https://api.vybesec.io/v1/projects \
  -H "Authorization: Bearer sk_live_YOUR_SECRET_KEY"

Projects

GET
/v1/projectsList all projects in your account
POST
/v1/projectsCreate a new projectReturns the new project and its public SDK key
GET
/v1/projects/:idGet a single project by ID

Issues

GET
/v1/projects/:id/issuesList issues for a project — paginated, sortable by impactSupports ?status=open|resolved|ignored&limit=50&cursor=
GET
/v1/projects/:id/issues/:fpGet a single issue with full AI analysis and fix prompt:fp is the error fingerprint hash
PATCH
/v1/projects/:id/issues/:fpUpdate issue statusBody: { "status": "resolved" | "ignored" | "open" }

Analytics

GET
/v1/projects/:id/analyticsError counts, affected users, and trend data for a time rangeSupports ?from=&to= as ISO timestamps
GET
/v1/projects/:id/vitalsWeb Vitals (LCP, INP, CLS, FCP, TTFB) — Pro+ only

Security

GET
/v1/projects/:id/securitySecurity health score (0–100) and active findingsStarter+ plans. Includes finding type, severity, and fix prompt.

Alerts

GET
/v1/projects/:id/alertsList all alert rules for a project
POST
/v1/projects/:id/alertsCreate a new alert rule
PATCH
/v1/projects/:id/alerts/:alertIdUpdate an alert rule
DELETE
/v1/projects/:id/alerts/:alertIdDelete an alert rule
// Webhooks

Webhooks

Get notified in your own systems the moment something happens in VybeSec.

Events

Subscribe to any of these events in Dashboard → Project → Settings → Webhooks. VybeSec will POST a signed JSON payload to your URL within seconds of the event firing.

issue.newhigh
A new error fingerprint appears for the first time — something your app has never crashed on before
issue.resolvedlow
An issue is marked resolved in the dashboard
issue.regressedhigh
A previously resolved issue reappears — something you thought was fixed broke again
alert.firedhigh
An alert rule threshold was breached — e.g. 10+ errors in 5 minutes
security.findinghigh
A new security vulnerability was detected, such as an exposed API key in an error log
digest.sentlow
The weekly digest email was delivered — useful for triggering your own reports

Verifying signatures

Every webhook request includes an X-VybeSec-Signature header — an HMAC-SHA256 signature of the raw request body, signed with your webhook secret. Always verify it before processing.

// Node.js / Next.js API route example
import crypto from "crypto"

export async function POST(req: Request) {
  const rawBody = await req.text()
  const signature = req.headers.get("x-vybesec-signature") ?? ""
  const secret = process.env.VYBESEC_WEBHOOK_SECRET!

  const expected = crypto
    .createHmac("sha256", secret)
    .update(rawBody)
    .digest("hex")

  if (signature !== `sha256=${expected}`) {
    return new Response("Unauthorized", { status: 401 })
  }

  const event = JSON.parse(rawBody)
  // handle event.type …
  return new Response("OK", { status: 200 })
}

Payload shape

All webhook payloads share the same envelope. The data field contains event-specific details.

{
  "id":        "evt_01J…",          // unique event ID — use for deduplication
  "type":      "issue.new",         // one of the event types above
  "projectId": "proj_01J…",
  "orgId":     "org_01J…",
  "createdAt": "2025-03-18T09:41:00Z",
  "data": {
    // event-specific payload
    // issue.new → { fingerprint, message, severity, affectedUsers }
    // alert.fired → { ruleName, threshold, count, windowMs }
    // security.finding → { type, severity, fixPrompt }
  }
}

Webhook deliveries are retried up to 3 times with exponential backoff (30s, 5min, 30min) if your endpoint returns a non-2xx status. After 3 failures the delivery is abandoned and logged in your dashboard.