Monitor Express APIs with a small SDK setup.
Install Watchlayer, connect your API key, register the endpoints that matter, and keep a clean view of uptime, latency, incidents, and alerts.
Installation
Add the SDK to your application with your preferred package manager.
npm install @watchlayer/sdkyarn add @watchlayer/sdkBasic setup
Initialize Watchlayer once near your Express app startup code, before your routes are registered.
import express from "express";
import { watchlayer } from "@watchlayer/sdk";
const app = express();
watchlayer({
apiKey: process.env.WATCHLAYER_API_KEY,
appName: "my-api",
environment: "production",
});
app.get("/api/users", (req, res) => {
res.json({ users: [] });
});
app.listen(3000, () => {
console.log("Server running on port 3000");
});Replace WATCHLAYER_API_KEY with an API key from your dashboard.
Create API groups
Groups keep related services organized, so production, staging, and internal APIs can have separate checks and alerts.
- 1Go to your dashboard and click Add API Group
- 2Give your API group a name, like Production APIs
- 3Verify your domain ownership
- 4Add the API endpoints you want to monitor
- 5Generate an API key for monitoring
Add endpoints
Register each route you want Watchlayer to check, including method, expected response time, and optional headers.
- 1Select your API Group from the dashboard
- 2Click Add Endpoint
- 3Enter the endpoint path, like /api/users
- 4Select the HTTP method
- 5Set expected response time in milliseconds
- 6Add any required headers or authentication details
Auto-monitoring: the SDK checks configured endpoints and alerts you when availability or latency drifts.
Manage API keys
Generate scoped keys from the dashboard, store them in your runtime environment, and rotate them when needed.
- 1Navigate to your API Group settings
- 2Click Generate New Key
- 3Give your key a meaningful name
- 4Copy the generated key and store it securely
- 5Add it to your environment variables
WATCHLAYER_API_KEY=wl_xxxxxxxxxxxxxxxxxxxxxxNever commit API keys to version control. Use environment variables or a secret manager.
Real-time monitoring
Once configured, Watchlayer gives you a clear operational view of your endpoints and the incidents around them.
Status Tracking
Real-time status and response times for every registered endpoint.
Instant Alerts
Get notified when endpoints go down or performance degrades.
Advanced Analytics
Track uptime, latency, incident history, and performance trends.
Secure by Default
Keep monitoring data protected with encrypted transport and storage.
Ready to connect your first API?
Open the dashboard, create a group, and add the key to your Express app.
Start monitoring