Easy to use Vue 3 composable for managing browser notifications
- ๐งฉ TypeScript Support
- ๐ Vue 3 Support
- โ Send & Close Browser Notifications
yarn add vue-browser-notifications
npm install vue-browser-notifications
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.
<script setup lang="ts">
import { useNotifications } from 'vue-browser-notifications'
const { requestPermission, sendNotification } = useNotifications(true, { icon: 'https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png'})
sendNotification('Hello World', { body: 'Hallo Welt' })
</script>
MIT License - Conner Luka Bachmann