Package Exports
- @rbxts/logsnag
- @rbxts/logsnag/out/init.lua
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@rbxts/logsnag) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
LogSnag is a SaaS for event logging and monitoring. This package provides a brief SDK over the LogSnag API.
Example
const logsnag = new LogSnag({
project: "project-name",
token: "api-token"
});
// logs
const sales = logsnag.getChannel("sales");
sales.log("Product Sold", {
description: `${player.Name} bought ${product.Name}!`
user_id: player.UserId,
icon: "🤑",
tags: {
product_id: product.Id,
price: product.Price
}
});
// insights
const visits = logsnag.getInsight("Visits");
visits.set(0);
Players.PlayerAdded.Connect(() => {
visits.increment(1);
});
// identify
Players.PlayerAdded.Connect((player) => {
logsnag.identify(tostring(player.UserId), {
membership: player.MembershipType.Name
});
});