
Security News
Ruby's Bundler 4.0.18 Extends Cooldown to bundle lock and bundle cache
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.
@mayday.sh/sdk
Advanced tools
Know when your third-party APIs break before your users do.
Mayday monitors every outbound HTTP call your Node.js application makes — Stripe, OpenAI, Twilio, AWS, and 100+ services — and alerts you the moment something degrades.
One SDK. Three lines of code. Real-time dependency health.
import { init } from '@mayday.sh/sdk'
init({ apiKey: 'md_live_...' })
// That's it. Every outbound HTTP call is now monitored.
When a third-party API your app depends on starts failing, you need to know immediately — and you need to know if it's them or you.
No request/response bodies are ever captured. URLs are sanitized in-process before any data leaves your application. See Privacy.
npm install @mayday.sh/sdk
Requires Node.js 18+.
Sign up at app.mayday.sh — one click with GitHub, no credit card.
Express / Fastify / any Node.js server:
// At the top of your entry file (server.ts, index.ts, app.ts)
import { init } from '@mayday.sh/sdk'
init({ apiKey: process.env.DEPWATCH_API_KEY })
// ... rest of your app
import express from 'express'
const app = express()
Next.js (instrumentation hook):
// instrumentation.ts (project root)
export async function register() {
if (process.env.NEXT_RUNTIME === 'nodejs') {
const { init } = await import('@mayday.sh/sdk')
init({ apiKey: process.env.DEPWATCH_API_KEY })
}
}
Important: Call init() as early as possible, before any HTTP calls are made.
Make some requests in your app and open your Mayday dashboard. You'll see every third-party service auto-discovered and categorized within 60 seconds.
init({
// Required: your API key
apiKey: 'md_live_...',
// Disable monitoring (e.g., in test environments)
// Default: true
enabled: process.env.NODE_ENV !== 'test',
// How often to export metrics (milliseconds)
// Default: 30000 (30 seconds). Minimum: 5000.
flushIntervalMs: 30000,
// Domains to exclude from monitoring
// The backend domain (api.mayday.sh) is auto-excluded.
ignoreDomains: ['localhost', 'your-internal-api.local'],
// Log every intercepted call to console (for verifying setup)
// Default: false
debug: true,
// Custom backend URL (for self-hosted or local dev)
// Default: 'https://api.mayday.sh'
endpoint: 'http://localhost:3001',
})
For each outbound HTTP request, the SDK records:
| Field | Example | Purpose |
|---|---|---|
| Domain | api.stripe.com | Service identification |
| Endpoint | /v1/charges/{id} | Endpoint-level metrics |
| Method | POST | Endpoint grouping |
| Status code | 200 | Error rate calculation |
| Total duration | 145ms | Latency tracking |
| DNS time | 2ms | "Is it us or them?" |
| TCP connect time | 15ms | Network diagnosis |
| TLS time | 20ms | TLS issue detection |
| Time to first byte | 108ms | Server processing time |
| Error flag | false | Error detection |
These fields are aggregated into 1-minute statistical buckets (count, min, max, P50, P95, P99, status code distribution) before export. Raw per-request data never leaves your application.
URL sanitization runs in-process before any data leaves your application:
Input: https://api.stripe.com/v1/charges/ch_3MqAyZ2eZvKYlo/capture?expand[]=balance_transaction
Output: domain: api.stripe.com
endpoint: /v1/charges/{id}/capture?expand=
{id}{id}{id}The SDK is designed to be invisible in production:
| Metric | Target | How |
|---|---|---|
| Latency overhead | <0.1ms per call | Event listeners, no sync work in request path |
| CPU | <0.5% of one core | Aggregation only, no serialization per request |
| Memory | <10MB RSS | Bounded ring buffer, DDSketch percentiles |
| Network | <50KB/min exported | 1-min aggregation reduces volume 100-500x |
| Startup | <50ms | Channel subscription + timer setup |
The export timer uses setInterval().unref() — it won't prevent your process from exiting.
The SDK uses two complementary interception strategies:
diagnostics_channel (primary): Subscribes to undici's diagnostic events. Covers native fetch() in Node 18+ and direct undici usage. Zero monkey-patching.
http.request patch (fallback): Wraps Node's http.request() and https.request(). Covers axios, got, node-fetch v2, and any library using the built-in http module.
These are disjoint code paths — undici does not use Node's http module. Both are always enabled. Zero double-counting.
import { shutdown } from '@mayday.sh/sdk'
process.on('SIGTERM', async () => {
await shutdown() // Final metric flush + restore patched functions
process.exit(0)
})
"I don't see any services on the dashboard"
debug: true is set — you should see log lines like:
[mayday] POST api.stripe.com/v1/charges → 200 (145.2ms)
enabled isn't set to falsemd_live_ (not md_test_)https://api.mayday.sh)"Some HTTP calls aren't being captured"
init() is called. Make sure init() runs before your app makes any requests.localhost or your own backend aren't captured by default — but you can check ignoreDomains to be sure."I'm worried about performance impact"
debug: true temporarily and watch the console. The overhead is sub-millisecond.init(config: MaydayConfig): voidInitialize the SDK. Call once at application startup.
shutdown(): Promise<void>Gracefully shut down: performs a final metric flush and restores all patched functions.
MaydayConfig| Option | Type | Default | Description |
|---|---|---|---|
apiKey | string | (required) | API key (md_live_* or md_test_*) |
enabled | boolean | true | Kill switch |
flushIntervalMs | number | 30000 | Export interval (min 5000) |
ignoreDomains | string[] | [] | Domains to exclude |
debug | boolean | false | Log intercepted calls |
endpoint | string | https://api.mayday.sh | Backend URL |
appId | string | null | App identifier (multi-app) |
MIT
FAQs
Third-party API dependency monitoring SDK
We found that @mayday.sh/sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.

Company News
Socket is now in the AWS Security Hub Extended plan. Adopt it through AWS, apply committed spend, and block malicious open source packages.