@customerlog/vue
v0.2.2
Published
Vue bindings for customer.log — console.log for your startup
Readme
@customerlog/vue
The official Vue bindings for customer.log.
Wraps the core @customerlog/sdk with a Vue plugin, a useCustomerLog() composable, and automatic browser session tracking.
<script setup lang="ts">
import { useCustomerLog } from "@customerlog/vue";
const { log } = useCustomerLog({ apiKey: "cl_xxx" });
log({
channel: "signups",
title: "User signed up",
level: "success",
notify: true,
});
</script>Install
npm install @customerlog/vue @customerlog/sdkUsage
Plugin (recommended)
import { createApp } from "vue";
import { customerLog } from "@customerlog/vue";
const app = createApp(App);
app.use(customerLog, { apiKey: import.meta.env.VITE_CUSTOMER_LOG_API_KEY });Then in any component:
const { log } = useCustomerLog();Composable with a config (no plugin needed)
const { log, pageView } = useCustomerLog({ apiKey: "cl_xxx" });API
| Export | Description |
|--------|-------------|
| customerLog plugin | app.use(customerLog, config) — provides a shared client |
| installCustomerLog(app, config) | Programmatic alternative to the plugin |
| useCustomerLog(config?) | Returns { log(options), pageView(path?, metadata?) } |
| CustomerLog | The core client (for advanced use) |
| CustomerLogError | Error class with .status |
See the core SDK docs for the full log() options table.
License
MIT
