@rbxts/logsnag
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

CI CD docs npm

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
    });
});

Readme

Keywords

Package Sidebar

Install

npm i @rbxts/logsnag

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

14.9 kB

Total Files

14

Last publish

Collaborators

  • minstrix