SaasHound client for Vue applications
To install the saashound vue.js library, run the following command:
npm install saashound-vuejs
yarn add saashound-vuejs
pnpm install saashound-vuejs
First, install the SaasHound plugin in your Vue application:
import './assets/main.css' import { createApp } from 'vue'import App from './App.vue'import router from './router'import { SaasHound } from 'saashound-vuejs' const app = createApp(App) app.use(router) app.use(SaasHound, { token: 'API_TOKEN', project: 'PROJECT_NAME', trackPageViews: false,}) app.mount('#app')
Then, import the functions you need from the package:
import { logEvent, sendMetric, identify } from 'saashound-vuejs' // Set the user id for the current usersetUserId('user-123') // Track an eventlogEvent({ channel: 'payments', title: 'New Customer', userId: 'user-123', icon: '💰', notify: true, tags: { plan: 'premium', cycle: 'onetime', trial: false, },}) // Send a metricsendMetric({ title: 'Users', value: 1254, icon: '👥', increment: false,}) // Identify a useridentify({ userId: 'user-123', properties: { name: 'John Doe', email: 'john@doe.com', plan: 'premium', },})