nuxt-logtail
TypeScript icon, indicating that this package has built-in type declarations

1.5.0 • Public • Published

NuxtLogtail

npm version npm downloads License Nuxt

Logtail implementation for nuxt 3, if no source token provided, just behaves like the default console

Features

  •  SSR compatible
  • 🚠  Hooks into console

Quick Setup

  1. Add nuxt-logtail dependency to your project
# Using pnpm
pnpm add -D nuxt-logtail

# Using yarn
yarn add --dev nuxt-logtail

# Using npm
npm install --save-dev nuxt-logtail
  1. Add nuxt-logtail to the modules section of nuxt.config.ts
export default defineNuxtConfig({
  modules: [
    'nuxt-logtail'
  ],

  nuxtLogtail: {
    // javascript source token from BetterStack
    sourceToken: process.env.BETTERSTACK_SOURCE_TOKEN,
  }
})

That's it! You can now use NuxtLogtail in your Nuxt app

Usage

Exposes a useLogtail composable, that can be used for logging, returns ether logtail browser or logtail node instance.

Development

# Install dependencies
npm install

# Generate type stubs
npm run dev:prepare

# Develop with the playground
npm run dev

# Build the playground
npm run dev:build

# Run ESLint
npm run lint

# Run Vitest
npm run test
npm run test:watch

# Release new version
npm run release

/nuxt-logtail/

    Package Sidebar

    Install

    npm i nuxt-logtail

    Weekly Downloads

    0

    Version

    1.5.0

    License

    MIT

    Unpacked Size

    8.9 kB

    Total Files

    11

    Last publish

    Collaborators

    • truesteps