@hawk.so/nuxt
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

@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

Readme

Keywords

none

Package Sidebar

Install

npm i @hawk.so/nuxt

Weekly Downloads

3

Version

1.0.0

License

MIT

Unpacked Size

13.1 kB

Total Files

23

Last publish

Collaborators

  • codex-team