{
  "@context": "https://schema.org",
  "@type": "TechArticle",
  "name": "Shield on a static site (no server) | Edge Docs",
  "headline": "Shield on a static site (no server) | Edge Docs",
  "description": "Using Shield on a static site with no backend: test the siteverify check from your laptop, see what Shield can protect, and add the smallest server-side step.",
  "url": "https://edge.network/docs/shield/static-sites",
  "image": "https://edge.network/og/docs__shield__static-sites.png",
  "inLanguage": "en",
  "publisher": {
    "@type": "Organization",
    "name": "Edge Network",
    "url": "https://edge.network",
    "logo": "https://edge.network/favicon.svg"
  },
  "isPartOf": {
    "@type": "WebSite",
    "name": "Edge Network",
    "url": "https://edge.network"
  },
  "breadcrumb": {
    "@type": "BreadcrumbList",
    "itemListElement": [
      {
        "@type": "ListItem",
        "position": 1,
        "name": "Home",
        "item": "https://edge.network"
      },
      {
        "@type": "ListItem",
        "position": 2,
        "name": "Docs",
        "item": "https://edge.network/docs"
      },
      {
        "@type": "ListItem",
        "position": 3,
        "name": "Shield",
        "item": "https://edge.network/docs/shield"
      },
      {
        "@type": "ListItem",
        "position": 4,
        "name": "Static sites",
        "item": "https://edge.network/docs/shield/static-sites"
      }
    ]
  },
  "section": "documentation/shield",
  "articleBody": "Docs CDN Deployments, domains, caching, purging and on-the-fly image optimisation. Getting started \n Deployments \n Domains & SSL \n Compute Virtual machines in seconds: networking, firewalls, backups and SSH keys. Getting started \n Creating VMs \n Managing VMs \n DNS Zones, records, geo-routing, backups and development domains. Getting started \n Zone management \n DNS records \n Storage S3-compatible buckets, access keys, presigned URLs and multipart uploads. Getting started \n Buckets \n Access keys \n Shield Privacy-first bot protection: widget modes, siteverify and verified agents. Getting started \n Widget modes \n JavaScript API \n Assist AI answers from your own content: widget, ingestion and the API. Getting started \n Widget & embedding \n Content ingestion \n Pulse Uptime monitoring from several locations: checks, incidents, alerts and status pages. Getting started \n Check types \n Locations & intervals \n REST API Manage every Edge resource over HTTPS with API keys. Authentication \n Errors \n Versioning \n Compute \n CDN \n DNS \n CLI One binary for macOS, Linux and Windows to script every product. Installation \n Authentication \n Compute commands \n CDN commands \n DNS commands \n Storage commands \n Dev tooling Command palette and keyboard shortcuts across the console. Command palette \n Agent tooling Let AI agents deploy and manage infrastructure: discovery, MCP and access codes. Start with the overview MCP server \n MCP tool reference \n Connect your tool \n Framework wrappers \n Self-signup \n Access codes \n Discovery endpoint \n Deploy a static site \n Deploy an app \n Projects \n Bot protection \n AI answers \n Uptime monitoring \n Account & support Teams, security, audit logs, alerts, billing tools and support. Start with the overview Teams \n Referral programme \n Cost Advisor \n Security \n Two-factor auth \n Audit log \n Alerts \n Support tickets \n Search the docs ⌘K Console Products\n\n CDN Compute DNS Storage Shield Overview Getting started Widget modes JavaScript API Server-side validation Offline verification Testing & CI Static sites Verified agents Turnstile migration Analytics Examiner Assist Pulse Developer tools\n\n REST API CLI Dev tooling Agents\n\n Agent tooling Account\n\n Account & support Where the check lives Copy Anchor Link \n\n Shield has two halves. The widget runs in the visitor&#x27;s browser, talks only to shield.edge.network , and drops a signed token into a hidden edge-shield-response input. The check is a single HTTP call to siteverify with your secret key, which confirms the token is genuine, unexpired and unused, and returns a humanity score.\n\n The check has to run somewhere that can hold the secret, which rules out the page itself. On a static site there&#x27;s nothing on your side to run it, so from the browser the integration looks half-finished. It isn&#x27;t. The widget half is done; the check simply needs a place to live, and for testing that place can be your terminal.\n\n Note\n\n What a static site has to protect. Shield gates actions : a form submit, a signup, an API call. It does not gate page views, and it can&#x27;t stop a bot reading a page the CDN serves to everyone. If your site has no form or endpoint that posts anywhere, there&#x27;s nothing for Shield to check yet, and that&#x27;s a fine place to be until there is.\n\n Test the check from your laptop Copy Anchor Link \n\n siteverify is just an HTTP call. You can make it with curl and watch the whole flow work end to end, no server required.\n\n Embed the widget Copy Anchor Link \n\n Use your real sitekey from Control → Shield . The form doesn&#x27;t need a real action yet.\n\n HTML Copy Text < script src =\" https://shield.edge.network/api.js \" defer ></ script > \n \n < form action =\" # \" method =\" post \"> \n < input name =\" email \" type =\" email \" required > \n < div class =\" edge-shield \" data-sitekey =\" es_your_sitekey \"></ div > \n < button > Send </ button > \n </ form > Complete the widget and copy the token Copy Anchor Link \n\n Load the page, let the widget reach its success state, then read the hidden input in the browser console. The token is a long string starting ey… .\n\n JavaScript Copy Text // In your browser&#x27;s console, after the widget shows its success state: \n document . querySelector (&#x27; [name=\"edge-shield-response\"] &#x27;). value \n \n // Or via the JS API if you rendered the widget yourself: \n edgeShield . getResponse ( widgetId ) Verify it from a terminal Copy Anchor Link \n\n This is exactly the call a server would make. Your secret is also in Control → Shield . You have five minutes from the widget completing before the token expires.\n\n Terminal Copy Text # From a terminal on your own machine. Never put the secret in your page. \n curl -X POST https://shield.edge.network/siteverify \\ \n -d \" secret=es_secret_... \" \\ \n -d \" response=PASTE_THE_TOKEN_HERE \" You should see the token accepted, with a score and the hostname it was minted for:\n\n JSON Copy Text { \n \" success \": true , \n \" score \": 87 , \n \" challenge_ts \": \" 2026-09-13T20:41:12.000Z \", \n \" hostname \": \" www.example.com \", \n \" error-codes \": [] \n } Run it again Copy Anchor Link \n\n Repeat the same curl with the same token. It fails. Tokens are strictly single-use, which is what stops a bot replaying one good solve across a thousand submissions.\n\n JSON Copy Text { \n \" success \": false , \n \" score \": 0 , \n \" hostname \": \" www.example.com \", \n \" error-codes \": [\" timeout-or-duplicate \"] \n } Using test keys instead Copy Anchor Link \n\n If you&#x27;d rather not use real keys yet, Shield ships fixed test keys that work on any hostname, including a page opened straight from disk, and record no analytics:\n\n HTML Copy Text <!-- Widget: always verifies, works on any hostname including localhost --> \n < div class =\" edge-shield \" data-sitekey =\" es_test_pass \"></ div > Terminal Copy Text # Terminal: always succeeds, score 90 \n curl -X POST https://shield.edge.network/siteverify \\ \n -d \" secret=es_secret_test_pass \" \\ \n -d \" response=anything \" Swap to es_test_block to see the no-token path, or es_secret_test_spent to see the replayed-token response. Full list on Testing & CI .\n\n Protecting a real form Copy Anchor Link \n\n Once you&#x27;re happy the check works, the question becomes: where does the form post to? Whatever answers that is where the siteverify call goes. Cheapest first:\n\n Your existing form service Copy Anchor Link \n\n If your forms already post to a hosted form backend, check whether it can call an HTTP endpoint before accepting a submission, or supports a custom verification step. If it does, point that at siteverify with your secret and forward the edge-shield-response field. If it can&#x27;t, it can&#x27;t verify anything, and the widget is decoration.\n\n A small function or VM in front of the form Copy Anchor Link \n\n About fifteen lines in any runtime. A serverless function, or the smallest Edge Compute VM, receives the submission, verifies the token, and only then does whatever the form is for. Keep the secret in an environment variable, never in the page.\n\n JavaScript Copy Text // The whole job of the function: verify, then do the thing. \n // Any serverless runtime, or a tiny Edge Compute VM, is enough. \n export default async function handler ( req ) { \n const form = await req . formData () \n const token = form . get (&#x27; edge-shield-response &#x27;) \n \n const verify = await fetch (&#x27; https://shield.edge.network/siteverify &#x27;, { \n method : &#x27; POST &#x27;, \n headers : { &#x27; Content-Type &#x27;: &#x27; application/x-www-form-urlencoded &#x27; }, \n body : new URLSearchParams ({ \n secret : process . env . SHIELD_SECRET , \n response : token ?? &#x27;&#x27;, \n remoteip : req . headers . get (&#x27; x-forwarded-for &#x27;) ?? &#x27;&#x27; \n }) \n }). then ( r => r . json ()) \n \n if (! verify . success || verify . score < 60 ) { \n return new Response (&#x27; Verification failed &#x27;, { status : 403 }) \n } \n \n // Verified human. Email it, post it to a webhook, write it to storage... \n await sendEmail ({ to : &#x...",
  "headings": [
    {
      "level": 1,
      "text": "Shield on a static site"
    },
    {
      "level": 2,
      "text": "Next steps"
    },
    {
      "level": 3,
      "text": "Server-side validation"
    },
    {
      "level": 3,
      "text": "Testing &amp; CI"
    }
  ],
  "relatedLinks": [
    {
      "@type": "WebPage",
      "name": "Network",
      "url": "https://edge.network/network"
    },
    {
      "@type": "WebPage",
      "name": "Pricing",
      "url": "https://edge.network/pricing"
    },
    {
      "@type": "WebPage",
      "name": "Docs",
      "url": "https://edge.network/docs"
    },
    {
      "@type": "WebPage",
      "name": "Sign in",
      "url": "https://edge.network/console/access"
    },
    {
      "@type": "WebPage",
      "name": "Getting started",
      "url": "https://edge.network/docs/cdn/getting-started"
    },
    {
      "@type": "WebPage",
      "name": "Deployments",
      "url": "https://edge.network/docs/cdn/deployments"
    },
    {
      "@type": "WebPage",
      "name": "Domains &amp; SSL",
      "url": "https://edge.network/docs/cdn/domains"
    },
    {
      "@type": "WebPage",
      "name": "Getting started",
      "url": "https://edge.network/docs/compute/getting-started"
    },
    {
      "@type": "WebPage",
      "name": "Creating VMs",
      "url": "https://edge.network/docs/compute/creating-vms"
    },
    {
      "@type": "WebPage",
      "name": "Managing VMs",
      "url": "https://edge.network/docs/compute/managing-vms"
    },
    {
      "@type": "WebPage",
      "name": "Getting started",
      "url": "https://edge.network/docs/dns/getting-started"
    },
    {
      "@type": "WebPage",
      "name": "Zone management",
      "url": "https://edge.network/docs/dns/zones"
    },
    {
      "@type": "WebPage",
      "name": "DNS records",
      "url": "https://edge.network/docs/dns/records"
    },
    {
      "@type": "WebPage",
      "name": "Getting started",
      "url": "https://edge.network/docs/storage/getting-started"
    },
    {
      "@type": "WebPage",
      "name": "Buckets",
      "url": "https://edge.network/docs/storage/buckets"
    },
    {
      "@type": "WebPage",
      "name": "Access keys",
      "url": "https://edge.network/docs/storage/access-keys"
    },
    {
      "@type": "WebPage",
      "name": "Getting started",
      "url": "https://edge.network/docs/shield/getting-started"
    },
    {
      "@type": "WebPage",
      "name": "Widget modes",
      "url": "https://edge.network/docs/shield/widget-modes"
    },
    {
      "@type": "WebPage",
      "name": "JavaScript API",
      "url": "https://edge.network/docs/shield/js-api"
    },
    {
      "@type": "WebPage",
      "name": "Getting started",
      "url": "https://edge.network/docs/assist/getting-started"
    },
    {
      "@type": "WebPage",
      "name": "Widget &amp; embedding",
      "url": "https://edge.network/docs/assist/widget"
    },
    {
      "@type": "WebPage",
      "name": "Content ingestion",
      "url": "https://edge.network/docs/assist/ingestion"
    },
    {
      "@type": "WebPage",
      "name": "Getting started",
      "url": "https://edge.network/docs/pulse/getting-started"
    },
    {
      "@type": "WebPage",
      "name": "Check types",
      "url": "https://edge.network/docs/pulse/check-types"
    },
    {
      "@type": "WebPage",
      "name": "Locations &amp; intervals",
      "url": "https://edge.network/docs/pulse/locations"
    },
    {
      "@type": "WebPage",
      "name": "Authentication",
      "url": "https://edge.network/docs/api/authentication"
    },
    {
      "@type": "WebPage",
      "name": "Errors",
      "url": "https://edge.network/docs/api/errors"
    },
    {
      "@type": "WebPage",
      "name": "Versioning",
      "url": "https://edge.network/docs/api/versioning"
    },
    {
      "@type": "WebPage",
      "name": "Compute",
      "url": "https://edge.network/docs/api/compute"
    },
    {
      "@type": "WebPage",
      "name": "CDN",
      "url": "https://edge.network/docs/api/cdn"
    }
  ],
  "alternateFormats": [
    {
      "@type": "MediaObject",
      "contentType": "text/html",
      "url": "https://edge.network/docs/shield/static-sites",
      "name": "HTML version"
    }
  ],
  "dateModified": "2026-12-03T03:03:58.681Z"
}