0.0.2 • Published 6 months ago

saashound-vuejs v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

SaasHound Vue

Getting Started

Install

yarn add saashound-vuejs

Usage

SaasHound Plugin

To use SaasHound in your Vue app, you need to register the plugin at the top level of your application. The plugin requires token and project props to be passed in the options.

import { createApp } from 'vue'
import App from './App.vue'
import { SaasHound } from 'saashound-vuejs'

const app = createApp(App)

app.use(SaasHound, {
  token: 'API_TOKEN',
  project: 'PROJECT_NAME',
})

app.mount('#app')

Here's the revised section as a list:

SaasHound Methods

You can access the SaasHound methods in any Vue component through the $saashound property:

  • Track Events: Use the logEvent method to track custom events in your app.
  • Track Custom Metrics: Use the sendMetric method to track send custom metrics in your app.
  • Identify User Traits: Use the identify method to identify user traits.
  • Set User ID: Use the setUserId method to set the user ID for the current session.
  • Clear User ID: Use the clearUserId method to clear the user ID when logging out or resetting the session.

Let me know if you need any further changes!

<script>
import { logEvent, sendMetric, identify, setUserId } from 'saashound-vuejs'

setUserId('naomi-nagata')

logEvent({
  channel: 'navigation',
  title: 'Docking Successful',
  userId: 'naomi-nagata',
  icon: '🛳️',
  notify: true,
  description: 'Successful docking at Tycho Station.',
  tags: {
    dock: 'Bay 7',
    status: 'secured',
    crewCount: 11,
  },
})

sendMetric({
  title: 'Fuel Reserves',
  value: 45,
  icon: '⛽',
  increment: false,
})

identify({
  userId: 'naomi-nagata',
  properties: {
    name: 'Naomi Nagata',
    email: 'naomi@roci.com',
    role: 'Chief Engineer',
  },
})
</script>


<template>
  <div>
    <!-- Your component template -->
  </div>
</template>

Official Documentation


This README gives you a basic understanding of how to integrate SaasHound into a Vue.js application. You can refer to the official SaasHound documentation for more advanced use cases.

0.0.2

6 months ago

0.0.1

10 months ago