FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
doublelotus
doublelotussendNotification
Remix of gwoods22/sendNotification
Public
Like
sendNotification
Home
Code
2
README.md
main.tsx
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in miliseconds.
Sign up now
Code
/
Code
/
Search
README.md

Push Notification Sender

This val can be used in other vals to send notifications to a segment using OneSignal's REST API

This is really handy if you want to send push notifications to your phone without building a native app! I built a barebones React PWA that asks for a password then loads the OneSignal Web SDK that I deployed to Netlify for free. OneSignal has easy to follow docs so you can build this functionality into a React, Angular, Vue app or even Wordpress! Then install the PWA on your platform of choice and you're off to the races!

Setup

  1. Save your ONESIGNAL_TOKEN and SEGMENT_APPID from OneSignal to your Val Town environment variables

  2. Import into another val!

import sendNotification from "https://esm.town/v/gwoods22/sendNotification";

Code
README.mdmain.tsx
Go to top
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Product
FeaturesPricing
Developers
DocsStatusAPI ExamplesNPM Package Examples
Explore
ShowcaseTemplatesNewest ValsTrending ValsNewsletter
Company
AboutBlogCareersBrandhi@val.town
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.