Hawk error tracker integration for Nuxt app
Features
- 😋 Effortless installation
- 🦅 Track errors seamlessly across your Nuxt app
- 💼 Composable for manually sending errors and logs
- 💌 Sends release info with source maps
Quick Setup
Install the module with one command:
npx nuxi module add @hawk.so/nuxt
Then connect and configure to your nuxt.config.ts. Pass there an Integration Token you got from Hawk project.
You can pass it directly or use .env file wich is supported by Nuxt out of the box.
export default defineNuxtConfig({ modules: [ '@hawk.so/nuxt' ], hawk: { token: process.env.HAWK_TOKEN, }, })
Passing additional options
You can pass user, context, beforeSend and other JS Catcher options via catcherOptions config property.
export default defineNuxtConfig({ modules: [ '@hawk.so/nuxt' ], hawk: { token: process.env.HAWK_TOKEN, catcherOptions: { context: { // any data you want to send with all events appName: 'Hawk Nuxt Playground', }, // method for filtering/modifying an event to be sent beforeSend: (event) => { event.context.appVersion = '1.0.0' return event }, }, }, })
License
This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). See the LICENSE file for the full text.
Contribution
Local developmentCopy .env.example to the .env file in /playground. Put Hawk Integration Token in there.
# Install dependencies yarn # Generate type stubs yarn run dev:prepare # Develop with the playground yarn run dev # Build the playground yarn run dev:build # Run ESLint yarn run lint # Run Vitest yarn run test yarn run test:watch # Release new version yarn run release