Nuxt with AllStak

Monitor your Nuxt 3 app on both client and Nitro server with the AllStak Nuxt module.

Source repository:
AllStak/allstak-nuxt
Source README:
README.md
SDK version:
0.1.1
Installation source:
npm
Last verified:
2026-05-31

Installation

Install from npm (peer: nuxt@^3.7 || ^4).

npm install @allstak/nuxt

Configuration

Add the module and set public runtime config in nuxt.config.ts.

// nuxt.config.ts
export default defineNuxtConfig({
  modules: ['@allstak/nuxt'],
  runtimeConfig: {
    public: {
      allstak: {
        apiKey: process.env.ALLSTAK_API_KEY,
        environment: process.env.NODE_ENV,
        release: process.env.APP_VERSION,
      },
    },
  },
});

Basic example

On the client, capture via useAllStak (import from @allstak/nuxt/client).

import { useAllStak } from '@allstak/nuxt/client';

const allstak = useAllStak();
allstak.captureException(new Error('payment declined'));

Capturing errors

On the server, use the AllStak object from @allstak/nuxt/server.

// server/api/orders.post.ts
import { AllStak } from '@allstak/nuxt/server';

export default defineEventHandler(async (event) => {
  AllStak.addBreadcrumb({ type: 'order', message: 'creating order' });
  // ...
});

Tracking requests

Server requests are wrapped in an http.server span automatically; client route changes open a navigation span, and SSR trace meta tags stitch client and server traces. No manual call required.

Best practices

  • Set ALLSTAK_API_KEY and APP_VERSION as environment variables.
  • Use the /client and /server subpath imports in the right context.
  • Tune client/server tracesSampleRate under the allstak config key.