Skip to content

Latest commit

 

History

History
44 lines (31 loc) · 1.13 KB

README.md

File metadata and controls

44 lines (31 loc) · 1.13 KB

💬 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 { 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>

💚 License

MIT License - Conner Luka Bachmann