New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

mkt-notification-utils

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mkt-notification-utils

Utilities for displaying notifications

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
0
Created
Source

MKT - Notification Utils 🔔

mkt-notification-utils is a lightweight, dependency-free JavaScript utility for handling browser notifications with ease. It provides customizable notifications with icons, sounds, vibrations, and click events, allowing seamless integration into web applications.

🚀 Features

  • Simple API - Trigger notifications with just one function call.
  • Custom Icons & Sounds - Choose from predefined options or use your own.
  • Click Actions - Handle user interaction when clicking notifications.
  • Vibration Support - Define custom vibration patterns (mobile support).
  • Permission Handling - Request browser notification permission automatically.
  • No Dependencies - Pure JavaScript implementation.

📦 Installation

To install via npm, run:

npm install mkt-notification-utils

🎯 Quick Start

1️⃣ Import the module and initialize it

import { notificationUtil } from "mkt-notification-utils";

// Initialize permissions
notificationUtil.init();

2️⃣ Basic Notification

notificationUtil.notify({
    message: "Hello, world!"
});

🔔 Advanced Usage

📌 Notification with Custom Title & Sound

import { NotificationSounds } from "mkt-notification-utils";

notificationUtil.notify({
    title: "New Message",
    message: "You have a new notification!",
    sound: NotificationSounds.ALARMING
});

📌 Notification with Custom Icon & Click Event

import { NotificationIcons } from "mkt-notification-utils";

notificationUtil.notify({
    title: "Click Me!",
    message: "Click to open Google",
    icon: NotificationIcons.ROBOT,
    onClick: () => window.open("https://google.com", "_blank")
});

📌 Notification with Vibration (Mobile Support)

notificationUtil.notify({
    message: "This notification will vibrate!",
    vibrate: [200, 100, 200]
});

🎨 Customization

🔊 Available Sounds

import { NotificationSounds } from "mkt-notification-utils";

console.log(NotificationSounds);
Sound NameURL
ENGAGEfile-sounds-760-engaged.ogg
SUNNYfile-bb_sunny.ogg
ALARMINGfile-sounds-738-alarming.ogg
CUCKOOfile-5b_cuckoo-clock-2.ogg
INFORMEDfile-sounds-751-youve-been-informed.ogg
NEW_FOR_YOUfile-sounds-1253-asmr-girl-i-got-news-for-you.ogg

🖼️ Available Icons

import { NotificationIcons } from "mkt-notification-utils";

console.log(NotificationIcons);
Icon NamePreview
ALARMAlarm
BELLBell
MESSAGEMessage
ROBOTRobot
BOMBBomb

📜 License

This project is licensed under the MIT License.

🚀 Contributing

Pull requests are welcome! If you’d like to improve the library, please open an issue first to discuss changes.

Keywords

notification

FAQs

Package last updated on 28 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts