Docs/Getting Started/First Event

Your First Event

After installing the SDK, here's how to verify everything works.

Browser JavaScript

<script type="module">
  import * as Unseenr from "@unseenr/node";

  Unseenr.init({
    dsn: "https://<YOUR_PUBLIC_KEY>@app.unseenr.io/<PROJECT_ID>",
  });

  // Trigger a test error
  document.getElementById("test-btn")?.addEventListener("click", () => {
    try {
      throw new Error("Unseenr test error");
    } catch (e) {
      Unseenr.captureException(e);
      console.log("Error sent to Unseenr!");
    }
  });
</script>

Node.js

import * as Unseenr from "@unseenr/node";

Unseenr.init({
  dsn: "https://<YOUR_PUBLIC_KEY>@app.unseenr.io/<PROJECT_ID>",
});

// Send a test error
Unseenr.captureException(new Error("Hello from Unseenr!"));

What Happens Next

  1. The SDK serializes the error into a Sentry-compatible envelope
  2. The envelope is POSTed to https://app.unseenr.io/api/<PROJECT_ID>/envelope
  3. Unseenr validates the public key and checks rate limits
  4. The event is queued for async processing
  5. The worker creates or updates an Issue based on the error fingerprint
  6. The issue appears in your project's Issues page

Verifying the Event

Navigate to your project dashboard and click Issues in the sidebar. You should see your test error grouped into an issue with:

  • The error message as the title
  • Event count of 1
  • Status: UNRESOLVED
  • Level: ERROR

Click the issue to see the full event details including stack trace, breadcrumbs, and context.

Response Headers

The ingest endpoint returns useful headers:

Header Description
X-Unseenr-Usage Current usage like 1/5000 (events used / quota)
X-Unseenr-Usage-Percent Usage percentage as integer
X-Unseenr-Quota-Warning Present and set to true when usage exceeds 75%
X-RateLimit-Remaining Remaining requests in the current rate limit window
X-RateLimit-Reset Timestamp when the rate limit window resets
Also available in:Deutsch