@bugwalk/nuxt
v0.2.3
Published
Nuxt module for Bugwalk: zero-config client instrumentation
Readme
@bugwalk/nuxt
Nuxt 3 module for Bugwalk. Two lines of config and nothing else.
Install
npm install @bugwalk/nuxtUse
// nuxt.config.ts
export default defineNuxtConfig({
modules: ['@bugwalk/nuxt'],
bugwalk: {
dsn: process.env.NUXT_PUBLIC_BUGWALK_DSN,
},
});That is the whole setup. The module registers a client plugin that installs the Vue adapter and instruments Vue Router, so navigation is recorded by matched route rather than by raw URL.
Options
Everything @bugwalk/browser accepts,
except transport and beforeSend, which cannot survive being serialised into runtime
config. To use beforeSend, write your own client plugin with @bugwalk/vue directly.
| Option | Default | |
| --- | --- | --- |
| dsn | — | Required. Without it the module warns and does nothing. |
| enabled | true | Set to false to install without starting, for a staged rollout. |
| environment | — | Usually production or staging. |
| release | — | A version or commit SHA. Needed for stack traces to resolve to source. |
Options come from runtimeConfig.public, so the same build can be promoted between
environments with only an environment variable changing:
NUXT_PUBLIC_BUGWALK_DSN=hs_pub_... node .output/server/index.mjsIdentify the person
<script setup lang="ts">
import { useBugwalk } from '@bugwalk/vue';
const { identify } = useBugwalk();
const { user } = useUserSession();
watchEffect(() => {
if (user.value) identify({ id: user.value.id, email: user.value.email });
});
</script>Apache-2.0
