npm install butterflyfx-client
All examples require generating an API key from the website before making any requests.
ButterflyFX has the ability to connect to your localhost or any other internal resources through its tunneling feature.
However, this feature does not work through the browser and requires using node or a node based task runner such as gulp, grunt, karma, ember-cli, webpack, etc.
// npm install butterflyfx-clientconst API_KEY = "INSERT-API-KEY-HERE";const PROJECT_ID = 0; // Replace with specific project id or leave as zero for defaultconst ButterflyFX = ;let client = project:PROJECT_ID token:API_KEY;// Only works when run from a node based task runner.// e.g karma.conf.js, gulpfile.js, ember-cli-build.js, etcclient;
Adding a new fixture
You can create new fixtures from either the browser or node client. By default, the browser client captures the entire document, but you also specify any arbitary html document or html segment as a string.
const API_KEY = "INSERT-API-KEY-HERE";const PROJECT_ID = 0;const ButterflyFX = ;let client = project:PROJECT_ID token:API_KEY;// An ordinary html string can be used here instead of document.querySelectorlet html = documentouterHTML;client;