Install with a coding agent
Paste one prompt into Claude Code, Cursor or GitHub Copilot. It fetches the Script Monitoring setup guide and installs the tag with your script URL.
You can let a coding agent install Script Monitoring: copy the prompt from Developers > Setup, step 3, Coding agent, and paste it into Claude Code, Cursor, GitHub Copilot or a similar tool. The prompt tells the coding agent to fetch our setup guide, detect your framework and add the tag with your team's script URL.
What is the prompt?#
The Coding agent panel says: "Paste into your coding agent." Copy prompt copies one line, with your script URL filled in:
Fetch the Script Monitoring installation guide from https://docs.scriptmonitoring.com/ai-setup.md and follow the instructions to add Script Monitoring client-side security monitoring to this project. Use this script URL: https://<teamID>.cdn.scriptmt.com/sm.js
How do I use it?#
- In the dashboard, open Developers > Setup, go to step 3, Install, and pick Coding agent.
- Click Copy prompt.
- Open your project in your coding agent and paste the prompt.
- Review the change before you merge it:
- the tag (or
ScriptMonitoringScript, or thescriptMonitoring()plugin) is the first script in the<head>, with noasyncordefer; - nothing else in the
<head>was removed or reordered; - if the project has a Content Security Policy,
*.cdn.scriptmt.comwas added to the existingscript-srcandconnect-src, and nothing was removed.
- the tag (or
- Deploy, load a page and check Verify it's working.
What does the setup guide tell the coding agent?#
ai-setup.md is plain Markdown written for coding agents. First it makes the coding agent use your real script URL: it takes it from the prompt, asks you for it (or your team ID from Developers > Setup) if it is missing, never guesses one, and checks that the URL returns the script before it changes any file. Then it asks the coding agent to pick the method that fits the project (Next.js, Vite, the CLI for static builds, or HTML), keep the tag first and synchronous, add it only once, and extend an existing Content Security Policy instead of replacing it.
Frequently asked questions#
What does the coding agent read?
The prompt points it at ai-setup.md, a Markdown guide written for coding agents. It covers Next.js, Vite, static builds with the CLI, plain HTML and Content Security Policy changes.
Does the prompt contain anything secret?
No. It contains your team's script URL, which is public: every visitor's browser loads it.
Which coding agents does it work with?
Any coding agent that can fetch a URL and edit your project, such as Claude Code, Cursor or GitHub Copilot. If yours can't fetch URLs, paste the contents of ai-setup.md along with your script URL.