Skip to main content
This guide will help you set up VIJ error monitoring in your application. You’ll deploy the dashboard, integrate the SDK, and start tracking errors in production.

Prerequisites

Before you begin, ensure you have:
  • Node.js 18+ installed
  • MongoDB instance (local or cloud like MongoDB Atlas)
  • npm or bun package manager
  • A Google Gemini API key (optional, for AI features)

Step 1: Deploy VIJ Admin Dashboard

1

Clone the repository

Clone the VIJ Admin repository to your local machine:
git clone https://github.com/asengupta07/vij-admin.git
cd vij-admin
2

Install dependencies

Install the required npm packages:
npm install
You can also use bun install if you prefer Bun as your package manager.
3

Configure environment variables

Create a .env.local file in the root directory:
.env.local
MONGODB_URI=mongodb://localhost:27017/vij
NEXT_PUBLIC_BASE_URL=http://localhost:3000
GEMINI_API_KEY=your_gemini_api_key_here
MONGODB_URI is required. Without it, the application will not start. GEMINI_API_KEY is optional but recommended for AI-powered error analysis.
Learn more about environment variables →
4

Start the development server

Run the Next.js development server:
npm run dev
Open http://localhost:3000 to see your dashboard.
Your VIJ Admin dashboard is now running! You should see an empty dashboard ready to receive error logs.

Step 2: Integrate vij-sdk in Your Application

1

Install the SDK

Install vij-sdk in your application:
npm install vij-sdk
2

Initialize the SDK

Add VIJ initialization code to your application entry point:
  • Browser (React/Vue/etc)
  • Node.js (Express/Next.js)
  • Next.js App Router
main.js
import { init } from "vij-sdk";

init({
  endpoint: "http://localhost:3000/api/logs",
  appId: "my-app",
  environment: "production",
  batch: true,
  flushIntervalMs: 3000,
  maxBatchSize: 20
});
For React apps, add this to your main.jsx or index.js before rendering your app.
Use different appId values for frontend and backend to track them separately in the dashboard.
3

Test error tracking

Trigger a test error to verify integration:
import { captureException, captureMessage } from "vij-sdk";

// Test with a custom error
try {
  throw new Error("Test error from VIJ quickstart");
} catch (error) {
  captureException(error, { feature: "quickstart" });
}

// Or log a message
captureMessage("VIJ is working!", { test: true }, "info");
Check your dashboard at http://localhost:3000/logs — you should see your test error appear within a few seconds!

Step 3: Explore the Dashboard

Now that errors are flowing in, explore the dashboard features:

Next Steps

1

Configure SDK options

Customize batching, queue size, and other SDK settings for your use case.SDK Configuration →
2

Enable AI features

Set up Google Gemini for automatic error analysis and fix suggestions.AI Integration →
3

Deploy to production

Learn how to deploy VIJ Admin to Vercel, Docker, or your own infrastructure.Deployment Guide →
4

Explore advanced filtering

Use advanced filters, search, and grouping to find errors faster.Filtering & Search →

Troubleshooting

Check the following:
  • Ensure MongoDB is running and accessible
  • Verify MONGODB_URI in .env.local is correct
  • Check that endpoint in SDK init() points to your VIJ Admin URL
  • Look for network errors in browser console or server logs
  • Ensure CORS is not blocking requests (VIJ Admin allows all origins by default)
Common causes:
  • MongoDB is not running. Start it with mongod or check your cloud connection
  • MONGODB_URI environment variable is missing or incorrect
  • Firewall blocking MongoDB port (default: 27017)
Verify:
  • GEMINI_API_KEY is set in .env.local
  • API key is valid and has quota available
  • Check Next.js server logs for AI-related errors
AI features are optional. VIJ works perfectly without them — you just won’t see AI-generated summaries and fix suggestions.

What You’ve Accomplished

You’ve successfully:
  • Deployed the VIJ Admin dashboard locally
  • Integrated vij-sdk into your application
  • Sent your first error to the monitoring system
  • Explored the dashboard features
Your self-hosted error monitoring is now live! Continue reading to learn about advanced features and production deployment.