Documentation

Everything you need to integrate DevNexus into your stack. Explore the SDK, APIs, and best practices for resilient incident tracking.

1. Installation

The SDK is optimized for modern JavaScript environments, including Node.js, Next.js, React, and Edge Runtimes.

npm
npm install @devnexus/sdk
yarn
yarn add @devnexus/sdk

2. Initialization

Initialize DevNexus as early as possible in your application's lifecycle.

index.ts
import { DevNexus } from '@devnexus/sdk';// Initialize with your project API keyDevNexus.init({apiKey: 'dn_live_xxxxxxxxxxxxxxxx',environment: 'production',autoCaptureUncaught: true});

3. Capturing Errors

Manual Capture

Wrap your risky code in a try-catch block and send the error manually.

try {processPayment();} catch (error) {DevNexus.captureException(error, {tags: { component: 'checkout' }});}

Identify Users

Attach user context to errors to know exactly who is affected by an incident.

// Set context on loginDevNexus.setUser({id: 'user_123', email: 'jane@example.com', plan: 'enterprise'});

4. REST API

POST/api/ingest

Secure your requests by including your project token in the Authorization header.

Authorization: Bearer [SDK_API_KEY]

Payload Schema

JSON
{
  // Required
  "message": "Database connection timeout",
  
  // Optional Context
  "stack": "Error: timeout at ...",
  "tags": {
    "component": "database",
    "environment": "production"
  },
  "metadata": {
    "query": "SELECT * FROM users"
  }
}

5. Architecture & Limits

Rate Limiting

Endpoints allow up to 30 requests per minute per SDK Key. Overages return a 429 status. Batch processing is recommended for high traffic.

01

AI Analysis

Incident payloads trigger an asynchronous Gemini queue for root cause identification. Complex stack traces may take up to 2 seconds to process.

02

Data Integrity

Payloads exceeding 256KB are truncated to ensure high performance ingestion. Always ensure log rotation for extreme trace lengths.

03

Still have questions?

Join our Discord community or reach out to enterprise support.