LogoLogo
  • Welcome to the Spec Docs
  • Getting Started
    • DNS Integration
  • Service Workers
    • AWS Edge@Lambda
    • Cloudflare Worker
    • Fastly Compute
  • Concepts
    • Processing Modes
    • Testing
    • Regional Deployments
    • Data Collection
Powered by GitBook
On this page
  • Supported Providers
  • Config
  • Why Service Workers?

Service Workers

Integration libraries to support a variety of edge networking and service worker providers.

PreviousDNS IntegrationNextAWS Edge@Lambda

Last updated 8 months ago

Supported Providers

Spec maintains public Cloud Service Provider-specific npm packages to integrate with the Spec Platform.

If Spec doesn't support a provider you need, contact your Product Success representative.

Config

Service Workers enable seamless integration with Spec at the CDN level. Our easy-to-use libraries handle everything in the background, and integration requires just one function call, with flexible configuration options for routing traffic to the Spec Platform.

The following are the configuration options that are common to all service workers:

Key
Type
Default
Notes

disableSpecProxy

Boolean

false

Enable or disable Spec processing. When disabled (true), all traffic bypasses Spec and goes directly to the customer's origin, ignoring all other settings.

inlineMode

Boolean

false

Switch between two processing modes:

Active Inline (true) routes traffic through the Spec Trust Cloud for inline mitigations.

Pass Through (false) duplicates traffic for Spec processing while sending the original directly to the customer's origin, without inline mitigations.

percentageOfIPs

Number

100

The percentage of IP addresses to route through Spec; the rest go directly to the customer's origin. Useful for gradual onboarding or rollout.

customerKey

String

none

A key from Spec to verify that traffic originates from a customer-controlled service worker.

Why Service Workers?

Service workers process data near users, reducing latency and enhancing real-time performance while optimizing bandwidth and improving security. Spec uses edge computing to route traffic from a CDN to the Spec Trust Cloud. It can either duplicate requests to Spec while sending the original to the origin server ("pass-through" mode) or forward requests directly to Spec, who in turn forwards requests to the origin server ("active" mode).

To learn more about the HTTP library's functionality, explore the source here:

NPM — Spec Proxy Service Worker
Cover

AWS Edge@Lambda

Cover

Cloudflare Worker

Cover

Fastly Compute

Cover

Akamai Worker