laptop-slashCan You Run Fibr on Your Local Machine?

Learn how to run the Fibr script on your local machine for testing and preview purposes, even though live campaigns won’t be active in this environment.

Short answer: No, Fibr cannot run on localhost or private development environments.

Here's why, and what you can do instead.


Why Fibr Requires a Public URL

The Fibr Script needs to communicate with our servers to:

  1. Check which experiments and personalization rules are active

  2. Determine which variant to show each visitor

  3. Send back analytics and conversion data

This communication requires a publicly accessible URL. When you run a site on localhost, 127.0.0.1, or a private IP address, Fibr's servers can't reach your site to validate the script or deliver experiences.


What About Private Staging Environments?

The same limitation applies to staging environments that:

  • Are behind a VPN

  • Require authentication to access

  • Use internal network addresses

  • Block external traffic

If Fibr can't reach the URL from the public internet, the script won't work.


How to Test Fibr During Development

Option 1: Use a public staging environment

Set up a staging site that's publicly accessible (even if it's not widely known). Add the Fibr Script to this environment and test there before deploying to production.

Tips for staging:

  • Use a subdomain like staging.yoursite.com

  • Add it to your Fibr workspace alongside your production domain

  • You can run separate experiments on staging for testing

Option 2: Use a tunnel service

Tools like ngrok, Cloudflare Tunnel, or localtunnel create a public URL that points to your local development server.

Example with ngrok:

bash

This gives you a URL like https://abc123.ngrok.io that Fibr can access. Add this URL to your Fibr workspace for testing.

Note: Tunnel URLs are temporary. You'll need to update your Fibr settings each time the URL changes.

Option 3: Test in production with limited traffic

If staging isn't an option, you can test safely in production:

  1. Create an experiment with a small traffic allocation (e.g., 5%)

  2. Use audience targeting to limit it to internal team members (by UTM parameter, cookie, or IP range)

  3. Validate the experience works correctly

  4. Gradually increase traffic once confirmed


Validating Your Script Locally

While Fibr won't fully function on localhost, you can still check if the script is installed correctly:

  1. Open your local site in a browser

  2. Open Developer Tools → Console

  3. Look for any Fibr-related errors

If the script loads without errors, it's installed correctly and will work once deployed to a public URL.


Need Help Testing?

If you're having trouble setting up a testing workflow, reach out to [email protected]envelope. We can help you find a solution that works for your development process.

Last updated