If you already have an account with micro stat we recommend you use the tutorial in the dashboard, as we provide customised code for you.
yarn add micro-stat
import { Connection } from 'micro-stat';
Connection.connect("<YOUR_DSN>");
// Import the Metric types you want to record
import { HitCounter, Counter } from 'micro-stat';
// Create a Hit Counter and immediately publish it
new HitCounter('Project Loaded').publish();
// Create a Counter and interact with it
const basketItemCount = new Counter('Number of Basket Items');
basketItemCount.value = 5;
basketItemCount.publish();