npm.io
1.1.1 • Published 4 years ago

vue-browser-notifications

Licence
MIT
Version
1.1.1
Deps
1
Size
5 kB
Vulns
0
Weekly
0
Stars
29

vue-browser-notifications

Easy to use Vue 3 composable for managing browser notifications

  • TypeScript Support
  • Vue 3 Support
  • Send & Close Browser Notifications

Installation

yarn add vue-browser-notifications

npm install vue-browser-notifications

Options

useNotifications(requestOnNotify: boolean, options?: NotificationOptions)

requestOnNotify

  • Default: true
  • Will request permissions everytime sendNotification is executed

options

  • Optional
  • Type: NotificationOptions
  • Will override options on sendNotifications, can be used for global Notification settings like Icons.

Example

<script setup lang="ts">
import { useTestComposable } from '../src/index'
const { requestPermission, sendNotification } = useTestComposable(true, { icon: 'https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png'})

sendNotification('Hello World', { body: 'Hallo Welt' })
</script>

License

MIT License - Conner Luka Bachmann