LogSnag client for Deno applications


// Deno's Node.js compatibility mode
import { LogSnag } from 'npm:@logsnag/node';
// Directly from the CDN.
import { LogSnag } from '';


const logsnag = new LogSnag({
  token: '<TOKEN>',
  project: '<PROJECT_NAME>'

// Track an event
await logsnag.track({
  channel: "payments",
  event: "New Subscription",
  user_id: "user-123",
  icon: "💰",
  notify: true,
  tags: {
    plan: "premium",
    cycle: "monthly",
    trial: false

// Identify user traits (e.g. name, email, plan, etc.)
await logsnag.identify({
  user_id: "user-123",
  properties: {
    name: "John Doe",
    email: "",
    plan: "premium",

// Track an insight
await logsnag.insight.track({
  title: "User Count",
  value: "100",
  icon: "👨",

// Increment an insight value
await logsnag.insight.increment({
  title: "User Count",
  value: 1,
  icon: "👨",

Disabling Tracking

You can disable tracking for development purposes by using the disableTracking method:


And enable it back with:


You can check if tracking is disabled with:



  • track(options: TrackOptions): Promise<boolean>: Track custom events.

  • identify(options: IdentifyOptions): Promise<boolean>: Identify user traits.

  • group(options: GroupOptions): Promise<boolean>: Group users.

  • insightTrack(options: InsightTrackOptions): Promise<boolean>: Track insights.

  • insightIncrement(options: InsightIncrementOptions): Promise<boolean>: Increment insight values.

Last updated