It can be useful for developing A/B tests or preparing some scripts for DTM.
Foso is especially usefull for writing Optimizely experiments. A/B testing tools like Optimizely are not good for code writing. Writing code in the browser and reloading the target page every time the code was changed is simply not effective.
With Foso it is possible to write all the code in an editor and the page will be updated automatically each time the code changes were saved.
You can read more about using Foso with Optimizely here.
$ npm install -g foso
Reference the files that you are serving on your pages. For example, on non-secure pages you'll have to add something like this:
The secure endpoint is
You can also add the links using Kibe. With Kibe you'll just have to write something like
The project structure has to be the following in order to work with Foso.
my-experiment├── target-page-type-1│ └── bundle.js├── target-page-type-2| └── bundle.js...└── target-page-type-n└── bundle.js
The foso server will host the bundled resources:
- target-page-type-1.js- target-page-type-2.js...- target-page-type-n.js
To see how the scripts are affecting the website, run
foso.on() in the console of the page. Foso scripts will be always added to the page until
foso.off() is executed.
my-experiment├── components| └── live-chat| ├── index.js| ├── index.css| └── index.html├── target-page-type-1| ├── index.css| ├── foo-template.html| └── bundle.js├── target-page-type-2| ├── bar.js| ├── foo.js| └── bundle.js...└── target-page-type-n└── bundle.js
Even though this project contains many js files, only the ones called bundle.js will be browserified and renamed to the folder name containing them.
The MIT License (MIT)