npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@aistudioapk/notifications

v1.0.1

Published

Local notifications for AIStudioAPK — renders web toasts in the browser, native Android notifications in APK builds

Readme

@aistudioapk/notifications

Local notifications for apps built with AIStudioAPK — renders web toasts in the browser for testing, native Android notifications in your APK automatically.

npm version license


How it works

Write your notification logic once using this library. In the browser it shows styled toast popups so you can test everything normally. When you build your APK with AIStudioAPK, the platform detects the library and automatically injects a native Android bridge — no code changes needed.

| Environment | Behaviour | |-------------|-----------| | Browser | Styled toast popup in the corner of the page | | APK (AIStudioAPK build) | Native Android notification |

If the library is not found in your project, the build skips injection entirely — no extra permissions, no bloat added to your APK.


Installation

npm install @aistudioapk/notifications

Quick start

import { notify } from '@aistudioapk/notifications'

// Show a notification immediately
await notify.show({
  title: 'Download complete',
  body: 'Your file is ready.',
  data: { screen: '/results' }
})

// Schedule one for later
await notify.schedule({
  title: 'Daily reminder',
  body: 'Check your dashboard',
  triggerAt: Date.now() + 24 * 60 * 60 * 1000,
  repeat: 'daily'
})

// Handle taps — register once on app startup
notify.onTap((data) => {
  console.log('Notification tapped:', data)
})

API

notify.show(options)Promise<void>

Show a notification immediately.

| Option | Type | Required | Description | |--------|------|----------|-------------| | title | string | ✅ | Notification heading | | body | string | ✅ | Notification message | | id | string \| number | — | Stable ID. Auto-generated if omitted. | | data | object | — | Payload forwarded to onTap callback | | icon | string | — | Emoji shown in browser toast | | sound | boolean | — | Play sound. Default: true | | vibrate | boolean | — | Vibrate device. Default: true | | priority | 'low' \| 'normal' \| 'high' | — | Android priority. Default: 'normal' | | ongoing | boolean | — | Persistent notification. Default: false |


notify.schedule(options)Promise<void>

Schedule a notification to fire at a future time. Survives app restarts on Android.

| Option | Type | Required | Description | |--------|------|----------|-------------| | triggerAt | Date \| number | ✅ | When to fire — Date or ms timestamp | | repeat | 'hourly' \| 'daily' \| 'weekly' \| number | — | Repeat interval. Pass ms for custom intervals. | | ... | | | All show() options are supported |


notify.cancel(id)Promise<void>

Cancel a displayed notification or pending alarm by ID.


notify.cancelAll()Promise<void>

Cancel all notifications and pending alarms.


notify.onTap(callback)void

Register a callback invoked when the user taps a notification. Call once on app startup.

notify.onTap((data) => {
  // data = the object you passed in show() or schedule()
  if (data.screen) router.push(data.screen)
})

notify.requestPermission()Promise<'granted' | 'denied' | 'not-determined'>

Request Android POST_NOTIFICATIONS permission. Always returns 'granted' in the browser.


notify.configure(config)void

Set global defaults. Call once before using other methods.

notify.configure({
  webPosition: 'top-right',   // where browser toasts appear
  defaultSound: true,
  defaultVibrate: true,
  defaultChannelId: 'general'
})

| Option | Type | Default | |--------|------|---------| | webPosition | 'bottom-right' \| 'bottom-left' \| 'top-right' \| 'top-left' \| 'top-center' \| 'bottom-center' | 'bottom-right' | | defaultSound | boolean | true | | defaultVibrate | boolean | true | | defaultChannelId | string | 'general' |


Examples

Process completion

async function runExport() {
  await generateReport()
  await notify.show({
    title: 'Export ready',
    body: 'Your report has been generated.',
    data: { screen: '/reports/latest' }
  })
}

notify.onTap(({ screen }) => {
  if (screen) router.push(screen)
})

Daily reminder with cancel

notify.schedule({
  id: 'daily-reminder',
  title: 'Good morning!',
  body: 'Your daily summary is ready.',
  triggerAt: new Date().setHours(9, 0, 0, 0),
  repeat: 'daily'
})

// Cancel it later
notify.cancel('daily-reminder')

Requirements

  • Built with AIStudioAPK for native Android support
  • Works in any React / Vue / Svelte / vanilla JS project

License

MIT © AIStudioAPK