Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/intevel/nuxt-logsnag

Easily connect your Nuxt 3 application with LogSnag πŸ“°
https://github.com/intevel/nuxt-logsnag

Last synced: about 9 hours ago
JSON representation

Easily connect your Nuxt 3 application with LogSnag πŸ“°

Awesome Lists containing this project

README

        

# Nuxt LogSnag πŸ“°

[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![Github Actions CI][github-actions-ci-src]][github-actions-ci-href]
[![License][license-src]][license-href]

> [LogSnag](https://logsnag.com) integration for [Nuxt 3](https://v3.nuxtjs.org)

- [✨  Release Notes](https://github.com/Intevel/nuxt-logsnag/releases)

## Features

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

## Setup

Install as development dependency with NPM or Yarn:

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

Add `nuxt-logsnag` to your Nuxt config:

```ts
// 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=
````

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

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

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

## Usage

```vue

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,
})
})

```

[![nuxt-logsnag](https://github.com/Intevel/nuxt-logsnag/blob/master/event.png?raw=true)](/)

## 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](./LICENSE) - 2022 Conner Luka Bachmann

[npm-version-src]: https://img.shields.io/npm/v/nuxt-logsnag/latest.svg
[npm-version-href]: https://npmjs.com/package/nuxt-logsnag
[npm-downloads-src]: https://img.shields.io/npm/dt/nuxt-logsnag.svg
[npm-downloads-href]: https://npmjs.com/package/nuxt-logsnag
[github-actions-ci-src]: https://github.com/intevel/nuxt-logsnag/actions/workflows/ci.yml/badge.svg
[github-actions-ci-href]: https://github.com/intevel/nuxt-logsnag/actions?query=workflow%3Aci
[license-src]: https://img.shields.io/npm/l/nuxt-logsnag.svg
[license-href]: https://npmjs.com/package/nuxt-logsnag