Skip to content
This repository has been archived by the owner on Apr 27, 2022. It is now read-only.

Intevel/nuxt-logsnag

Repository files navigation

Nuxt LogSnag 📰

npm version npm downloads Github Actions CI License

LogSnag integration for Nuxt 3

Features

  • Nuxt 3 ready
  • Easy integration
  • Handy composables
  • TypeScript support

Setup

Install as development dependency with NPM or Yarn:

yarn add --dev nuxt-logsnag
# or
npm i nuxt-logsnag --save-dev

Add nuxt-logsnag to your Nuxt config:

// nuxt.config.ts
import { defineNuxtConfig } from 'nuxt'

export default defineNuxtConfig({
  modules: ['nuxt-logsnag']
})

Lastly, add the LOGSNAG_API_TOKEN in your .env

LOGSNAG_API_TOKEN=<your_api_token>

Alternately, you can set it in the nuxt.config (less recommended to avoid sharing api token in your code):

// nuxt.config.ts
import { defineNuxtConfig } from 'nuxt'

export default defineNuxtConfig({
  modules: ['nuxt-logsnag'],
  logsnag: {
    token: '<YOUR_LOGSNAG_API_TOKEN>'
  }
})

Usage

<script setup>
const { publish } = useLogSnag()

onMounted(async () => {
  await publish({
    project: 'Test',
    channel: 'nuxt-test',
    event: 'Tested Module!',
    description: 'Hey, I just tested the Nuxt3 LogSnag module!',
    icon: '🎉',
    notify: true,
  })
})
</script>

nuxt-logsnag

Development

  1. Clone this repository
  2. Install dependencies using yarn install or npm install
  3. Start development server using yarn dev or npm run dev

License

MIT License - 2022 Conner Luka Bachmann

About

Easily connect your Nuxt 3 application with LogSnag 📰

Resources

License

Code of conduct

Stars

Watchers

Forks