Node.js Integration

Installation

Install the RocketGraph SDK using npm:

npm install @rocketgraph/sdk

Quick Start

Add the following code to your application:

const { RocketGraph } = require('@rocketgraph/sdk');

const rocket = new RocketGraph({
  apiKey: 'your-api-key',
  projectId: 'your-project-id'
});

// Start monitoring
rocket.start();

Advanced Configuration

The SDK can be configured with the following options:

  • apiKey: Your RocketGraph API key
  • projectId: Your project identifier
  • environment: The environment (development, staging, production)
  • logLevel: Logging level (debug, info, warn, error)

Features

  • Automatic error tracking
  • Performance monitoring
  • Custom event tracking
  • Network request monitoring

Examples

Custom Event Tracking

rocket.track('user_action', {
  action: 'button_click',
  userId: '123',
  timestamp: new Date()
});

Error Tracking

try {
  // Your code here
} catch (error) {
  rocket.captureError(error);
  throw error;
}