foozle-tracker
v1.0.22
Published
FoozleJS it's a tiny library that allow you to register errors of your web applications, and fix it faster
Downloads
3
Maintainers
Readme
FoozleJS
===================
FoozleJS it's a tiny library that allow you to register errors of your web applications, and fix it faster.
Tracking javascript errors.
How to use
- 1.- Clone the dashboard project (Dashboard project)
- 2.- Create a project and get the token generated.
- 3-. Call the https://cdn.jsdelivr.net/foozlejs/1.0.11/index.min.js file in your project and configure the token.
<script src="https://cdn.jsdelivr.net/foozlejs/1.0.11/index.min.js"></script>
<script type="text/javascript">
window._foozlejs = {
token: '<PROJECT_TOKEN>',
};
</script>
- 4.- If your application have any error, you will see it in the dashboard.
Or you can import foozleJS in your javascript and decide when you want to report an error
npm install --save foozle-tracker
import FoozleJS from 'foozle-tracker';
const foozle = new FoozleJS({ token: '<TOKEN_PROJECT>' }, window, document); // Window and Document are optionals
foozle.initAPI(); // To init listeners
foozle.api.track("Registering an error") // Send an error (String, object, etc..)
Example:
fetch(url_to_fetch, {
credentials: 'include',
method: 'POST',
}).then(() => {
// Whatever
}).catch((error) => {
foozle.api.track(error)
});
or
$.ajax("http://httpstat.us/500")
.done(() => {
console.log("ok");
}).fail((error) => {
foozle.api.track(error)
});
What FoozleJS offers?
All context of your application on the moment of the error. (Dependencies, Network, userAgent, consoles, and extra data)
Configurations.
<script type="text/javascript">
window._foozlejs = {
token: '<PROJECT_TOKEN>',
console: {
log: true, // console.warn("Registering console logs.")
warn: true, // console.warn("Registering console warn.")
error: true, // console.warn("Registering console error.")
},
};
</script>