Skip to content

HTML / Other

If your platform isn't listed, Botfighter works anywhere you can add a <script> tag.

Finding your Site ID

Log in at dash.botfighter.dev → your Site ID is shown at the top of the dashboard.

Any HTML page

Paste the snippet before </body> on every page:

html
<script
  src="https://botfighter.dev/botfighter.js"
  data-site="YOUR-SITE-ID"
  data-api="https://api.botfighter.dev"
  data-honeypot="true"
  defer>
</script>

This works with any server stack: Apache, nginx, Node.js, PHP, Ruby, Python, and more.

Single-page apps (React, Vue, Svelte, etc.)

Add the snippet once to your root index.html — the snippet initialises once per page load, which is correct for SPAs:

html
<!-- index.html -->
<body>
  <div id="root"></div>
  <script
    src="https://botfighter.dev/botfighter.js"
    data-site="YOUR-SITE-ID"
    data-api="https://api.botfighter.dev"
    data-honeypot="true"
    defer>
  </script>
</body>

PHP template example

php
<!-- footer.php or layout.php -->
<script
  src="https://botfighter.dev/botfighter.js"
  data-site="YOUR-SITE-ID"
  data-api="https://api.botfighter.dev"
  data-honeypot="true"
  defer>
</script>
</body>
</html>

Verify it's working

  1. Open DevTools → Network → filter by signal
  2. You should see a POST to https://api.botfighter.dev/signal returning {"ok":true}
  3. The visit appears in your dashboard within a few seconds

Need help? Open an issue on GitHub or check the dashboard for your live signal feed.

Open source under MIT License.