Logtail implementation for nuxt 3
npm install nuxt-logtail[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![License][license-src]][license-href]
[![Nuxt][nuxt-src]][nuxt-href]
Logtail implementation for nuxt 3, if no source token provided, just behaves like the default console
- ⛰ SSR compatible
- 🚠 Hooks into console
1. Add nuxt-logtail dependency to your project
``bashUsing pnpm
pnpm add -D nuxt-logtail
2. Add
nuxt-logtail to the modules section of nuxt.config.ts`js
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
`bash
Install dependencies
npm installGenerate type stubs
npm run dev:prepareDevelop with the playground
npm run devBuild the playground
npm run dev:buildRun ESLint
npm run lintRun Vitest
npm run test
npm run test:watchRelease new version
npm run release
``[npm-version-src]: https://img.shields.io/npm/v/nuxt-logtail/latest.svg?style=flat&colorA=18181B&colorB=28CF8D
[npm-version-href]: https://npmjs.com/package/nuxt-logtail
[npm-downloads-src]: https://img.shields.io/npm/dm/nuxt-logtail.svg?style=flat&colorA=18181B&colorB=28CF8D
[npm-downloads-href]: https://npmjs.com/package/nuxt-logtail
[license-src]: https://img.shields.io/npm/l/nuxt-logtail.svg?style=flat&colorA=18181B&colorB=28CF8D
[license-href]: https://npmjs.com/package/nuxt-logtail
[nuxt-src]: https://img.shields.io/badge/Nuxt-18181B?logo=nuxt.js
[nuxt-href]: https://nuxt.com