Install from npm (for bundlers):
npm install corepulse
Or simply copy corepulse.js to your project and include it via a <script> tag.
After including the SDK, initialize and start collecting metrics:
CorePulse.init({ interval: 2000, track: ['fps','memory'] });
CorePulse.start();
By default the SDK logs to browser console. To handle metrics yourself, assign CorePulse.onData:
CorePulse.onData = function(stats){
// stats contains fps, memory, network
console.log('received', stats);
};
Use CorePulse.sendTo(url) to POST collected data to your endpoint:
CorePulse.sendTo('https://your-server.example.com/metrics');
If you'd like to add features or fix bugs, fork the repo, make changes and open a pull request. Add tests under tests/ and update docs.
CorePulse is MIT-licensed — see LICENSE in the repo.