<script setup>
import { onMounted } from 'vue'
import { createSignal } from '@signal-js/browser'
let signal = null
onMounted(async () => {
signal = createSignal({ endpoint: '...', apiKey: '...', projectId: '...' })
await signal.start()
})
function identifyUser(userId, properties) {
signal?.identify(userId, properties)
}
function handleLogout() {
signal?.reset()
}
</script>
<template>
<button @click="identifyUser('user_123', { email: 'j@example.com', name: 'Jane' })">Log in</button>
<button @click="handleLogout">Log out</button>
</template>