Skip to content

Module for integration of Hawk.so error tracker to Nuxt 3 app

License

Notifications You must be signed in to change notification settings

codex-team/hawk.nuxt

Repository files navigation

@hawk.so/nuxt

npm version License Nuxt

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
      },
    },
  },
})

Contribution

Local development

Copy .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

About

Module for integration of Hawk.so error tracker to Nuxt 3 app

Resources

License

Stars

Watchers

Forks

Packages

No packages published