nuxt-logtail
v1.5.0
Published
Logtail implementation for nuxt 3
Downloads
4
Readme
NuxtLogtail
Logtail implementation for nuxt 3, if no source token provided, just behaves like the default console
Features
- ⛰ SSR compatible
- 🚠 Hooks into console
Quick Setup
- 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
- Add
nuxt-logtail
to themodules
section ofnuxt.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