Getting started

Installation

Install the SDK in Meteor 2, Meteor 3, or any Node.js project.

The Quickstart shows the happy path. This page covers every supported install method, including self-built containers, Docker images, and edge runtimes.

Meteor

UptimeClarity ships as an Atmosphere package. Install with:

meteor add uptimeclarity:agent

Then start it on the server:

server/main.js
import { Meteor } from 'meteor/meteor';
import { UptimeClarity } from 'meteor/uptimeclarity:agent';
 
Meteor.startup(() => {
  UptimeClarity.start({
    apiKey: process.env.UPTIMECLARITY_API_KEY,
    appName: 'my-app',
  });
});

The package detects whether your app is running on Meteor 2 (Fibers) or Meteor 3 (async). No version-specific configuration is required.

Meteor 3.6: add Instrumentation

On Meteor 3.6+, also add Meteor's instrumentation package:

meteor add instrumentation

The agent (1.7.0+) detects it automatically. You get subscription lifetimes, this.error() publication errors, hung-method detection, DDP connection lifetimes, and trace IDs across logs and outbound HTTP. See How instrumentation works.

Required Node version

Meteor versionRequired NodeNotes
2.x14.x – 16.xFibers-based runtime.
3.x18.x +Async runtime; Fibers shimmed.
3.6+26.x (bundled)Add instrumentation for the full DDP view.

Node.js (any framework)

For Express, Fastify, Hono, Koa, Nest, or anything else:

npm install @uptimeclarity/node
index.js
import { init } from '@uptimeclarity/node';
 
init({
  token: process.env.UPTIMECLARITY_TOKEN,
  // Optional — defaults are sensible.
  service: 'api',
  environment: process.env.NODE_ENV ?? 'production',
});

Docker

If you build your app into a container, ensure the runtime can reach https://api.uptimeclarity.com. No agent or sidecar is required.

Dockerfile
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --omit=dev
COPY . .
ENV UPTIMECLARITY_TOKEN=uc_live_…
CMD ["node", "index.js"]

Configuration sources

The SDK accepts configuration in this order of precedence (highest first):

  1. Direct call options — init({ token: '…' }).
  2. Environment variables — UPTIMECLARITY_TOKEN, UPTIMECLARITY_SERVICE, …
  3. Meteor settings — Meteor.settings.uptimeclarity (Meteor only).

Edge runtimes

Cloudflare Workers, Vercel Edge, and similar runtimes are not supported directly. Use the REST ingest API instead.