JavaScript
Please make sure to change your API token to `
Public Access`
in the LogSnag API settings when using the script on a public website.<script src="https://cdn.logsnag.com/js/0.1.6/ls.js"></script>
const logsnag = new window.LogSnag({
token: '7f568d735724351757637b1dbf108e5',
project: 'my-saas'
});
logsnag.publish({
channel: "waitlist",
event: "User Joined",
description: "Email: [email protected]",
icon: "🎉",
tags: {
name: "john doe",
email: "[email protected]",
},
notify: true
})
.then(result => console.log(result))
.catch(error => console.log(error));
logsnag.insight({
title: "User Count",
value: "100",
icon: "👨"
})
.then(result => console.log(result))
.catch(error => console.log(error));
Last modified 4mo ago