https://github.com/Intevel/vue-browser-notifications
💬 Easy to use Vue 3 composable for managing browser notifications
https://github.com/Intevel/vue-browser-notifications
Last synced: about 1 year ago
JSON representation
💬 Easy to use Vue 3 composable for managing browser notifications
- Host: GitHub
- URL: https://github.com/Intevel/vue-browser-notifications
- Owner: Intevel
- License: mit
- Created: 2022-08-14T17:28:49.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-10-06T18:55:55.000Z (over 3 years ago)
- Last Synced: 2025-04-26T10:04:36.577Z (about 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 96.7 KB
- Stars: 28
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# 💬 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
```ts
useNotifications(requestOnNotify: boolean, options?: NotificationOptions)
```
**`requestOnNotify`**
- Default: `true`
- Will request permissions everytime `sendNotification` is executed
**`options`**
- *Optional*
- Type: [NotificationOptions](https://github.com/Intevel/vue-browser-notifications/blob/master/src/types/index.d.ts#L1)
- Will override options on `sendNotifications`, can be used for global Notification settings like Icons.
## 💻 Example
```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' })
```
## 💚 License
MIT License - Conner Luka Bachmann