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
sendNotificationis 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