Learn how to setup metrics in your Typescript application.
Open the Vigilant dashboard and generate an API key.
Initialize the Vigilant SDK in your Typescript application.
import { initVigilant } from 'vigilant-js'
initVigilant({
name: 'backend',
token: 'tk_1234567890', // Use your API key from the dashboard
})
The Vigilant SDK provides a function to emit metrics.
import { metricEvent } from 'vigilant-js'
// Create a metric event
metricEvent('user_login', 1)
// Create a metric event with a custom tag
metricEvent('user_login', 1, { "env": "prod" })
The Vigilant SDK exposes a few setup options when you initialize it.
import { initVigilant } from 'vigilant-js'
initVigilant({
// Disable all functionality
noop: true,
})