Fastly No-Code Integration
Connect Monocle to your Fastly service without writing any code. Monocle deploys and manages a Compute service that enforces your policy at the edge.
Difficulty
Intermediate
Some product familiarity helpful
Time estimate
15 minutes
Typical time to complete
Prerequisites
- A Fastly account, with a user who has the Engineer or Superuser role
- A Monocle application
What you'll achieve
- Connect your Fastly account to Monocle
- Protect one or more domains through a Monocle-managed Fastly service
- Configure what blocked visitors see
Steps
- 1
Create a Fastly API token
In Fastly, go to Account > API tokens > Personal tokens and click Create Token. Give it these settings: Type: Automation, Scope: Global, Access: All services (or just the service you want to protect). Create the token while signed in as a user with the Engineer or Superuser role — other roles can produce a token that validates but can't actually deploy a service. Paste the token into Monocle to validate it; no changes are made to your Fastly account at this stage.
- 2
Choose the domain and origin
Add the domain(s) and path(s) you want to protect. Monocle checks whether a Fastly service already exists for that domain. If none is found, Monocle deploys a new one for you. If one is found, you'll be offered the option to chain alongside it instead of replacing it.
- 3
Optional: chain alongside an existing Fastly service
If you already run a Fastly service on the domain, chaining lets Monocle run alongside it rather than replacing it. For a VCL (Delivery) service, Monocle configures this automatically. For a Compute service, Monocle attaches an internal host and gives you a short code snippet to add to your own service, then verifies the connection once it's in place.
- 4
Configure the block response
Choose what a blocked visitor sees — a redirect to another URL, or a custom block page. This is the same block-response configuration used across Monocle's other integrations.
- 5
Deploy
Click Deploy Service. Monocle provisions everything it needs in your Fastly account under its own managed resources. You can update your protected domains or remove the integration at any time from your app's settings.
Related FAQs & guides
Do I need a backend to use Monocle?
No. You can use Monocle to gain visibility into traffic intelligence via the Monocle UI without acting on it. With a supported integration like Cloudflare, traffic can be enforced directly from the UI based on policy configuration. A backend is only required if you want to decrypt assessments or apply custom enforcement logic.
How do I integrate Monocle?
The most common way is by adding a JavaScript snippet to your application. You can also integrate Monocle using backend or edge-based approaches depending on your setup. See https://docs.spur.us/monocle/integrations for details.
How long does it take to see data?
Typically within minutes of integrating Monocle. In some cases, it may take up to an hour for data to appear in the dashboard.
What is the difference between using Monocle to monitor vs. enforce traffic decisions?
Monitor is passive: Monocle provides visibility into how users connect to your application without impacting users or taking any blocking action. Enforce applies actions such as blocking or allowing traffic based on Monocle's assessments. Most users start with a monitoring phase before configuring and enabling enforcement.
Expanding IP and Service Rows in the Explorer
Click any IP or service row in the Monocle Explorer's breakdown tables to expand an inline detail panel, without leaving the table.
Why did my Monocle assessment volume suddenly drop?
A sudden drop in assessment volume is usually caused by a change on your side — a recent deployment, a Content Security Policy (CSP) update, or a Cloudflare configuration change — rather than a Spur outage. Check your worker logs and recent configuration changes first. If volume still looks incorrect after that, contact support@spur.us with the time the drop started and any recent changes you made.