npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

cdmguardservice

v0.1.5

Published

SaaS cloaker — npm middleware for Express, Fastify, and Next.js. Real money page hidden from bots; integrate in one line.

Readme

cdmguardservice

SaaS cloaker middleware — Express, Fastify, ve Next.js için tek satır entegrasyon. Bot/uyumsuz ziyaretçiler money page'i hiç göremez.

npm

Kurulum

npm install cdmguardservice

Hızlı başlangıç

  1. dashboard.cdmguardservice.com üzerinden hesap aç
  2. /api-keys'den bir plaintext key mintle (sadece bir kez görünür — kopyala!)
  3. /campaigns/new'den bir kampanya kur (domain + safe URL + money URL + hedefleme)
  4. Aşağıdaki snippet'i sunucunuza ekleyin

Express

import express from "express";
import { cdmguard } from "cdmguardservice";

const app = express();

app.use(
  cdmguard({
    apiKey: process.env.CDMGS_KEY!,
    apiUrl: "https://api.cdmguardservice.com",
    failMode: "closed",          // closed (default) | open | cache_only
    trustProxy: "cloudflare",    // CF arkasındaysan ZORUNLU
    timeout: 200,
  }),
);

app.get("/", (req, res) => {
  // Bot ve uyumsuz ziyaretçiler buraya hiç gelmez.
  res.send("real money page");
});

app.listen(8080);

Fastify

import Fastify from "fastify";
import { cdmguardPlugin } from "cdmguardservice/fastify";

const app = Fastify({ logger: true });

await app.register(cdmguardPlugin, {
  apiKey: process.env.CDMGS_KEY!,
  trustProxy: "cloudflare",
});

app.get("/", async () => "ok");
await app.listen({ port: 8080 });

Next.js (middleware)

// middleware.ts
import { createMiddleware } from "cdmguardservice/next";

export default createMiddleware({
  apiKey: process.env.CDMGS_KEY!,
  trustProxy: "cloudflare", // ZORUNLU — Edge runtime'da socket IP yoktur
});

export const config = { matcher: "/:path*" };

Options

| Option | Default | Notu | |---|---|---| | apiKey | zorunlu | Plaintext API key (/api-keys) | | apiUrl | https://api.cdmguardservice.com | Decide endpoint | | failMode | 'closed' | API timeout/outage davranışı | | trustProxy | false | false | true | 'cloudflare' | 'aws-lb' | 'fastly' | string[] | | timeout | 200 | Decide call max ms | | edgeSecret | — | Edge sidecar varsa HMAC anahtarı | | logger | console | Pino-uyumlu logger |

Nasıl çalışır?

ziyaretçi → user-app + cdmguardservice middleware
                       │
                       ▼  POST /v1/decide
              api.cdmguardservice.com (decide engine)
                       │
                       ▼
              { decision, action, targetUrl, cookieValue }
                       │
                       ├── allow → next() → REAL MONEY PAGE
                       └── block → 302 → safe URL (handler hiç çalışmaz)

Detaylı mimari için Mimari ve Kavramlar.

Mobile cloaking (fake-mobile detection)

Antidetect tarayıcılar (AdsPower, Multilogin) masaüstünde mobile UA simüle eder. Mobile-only kampanyalarda visitor server-rendered ön-kontrolden geçer; geçmeyenler money page'i görmez.

Detay: Mimari → Fake Mobile Detection.

fail-mode

  • 'closed' (default) — API ulaşılmazsa block synth (güvenli)
  • 'open' — API ulaşılmazsa allow synth (sadece düşük-riskli host'lar için)
  • 'cache_only' — Sadece HMAC cookie kontrol; API hiç çağrılmaz

trust-proxy uyarısı

Yanlış config = IP spoofing açıklığı. Cloudflare arkasındaysan 'cloudflare'; AWS LB ile 'aws-lb'; standalone Node ile false bırak.

Doğrulama

# Bot UA — safe URL'e 302 düşer
curl -is https://your-money-domain.com/ \
  -H 'user-agent: python-requests/2.31.0'

# Gerçek browser UA — money page döner
curl -is https://your-money-domain.com/ \
  -H 'user-agent: Mozilla/5.0 (iPhone; CPU iPhone OS 17_2 like Mac OS X) AppleWebKit/605'

Dokümantasyon

Tam doc: dashboard.cdmguardservice.com/docs

Lisans

Proprietary. Bu paketi kullanmak için aktif bir cdmguardservice aboneliği gereklidir. Detay: LICENSE.