• Townie
    AI
  • Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
jrmann100

jrmann100

push

Send push notifications from your vals!
Public
Like
3
push
Home
Code
7
README.md
getVapidDetails.tsx
H
main.tsx
pushFrontend.js
pushSendNotification.tsx
subscription.tsx
tryPush.tsx
Branches
1
Pull requests
Remixes
5
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 milliseconds.
Sign up now
Code
/
README.md
Code
/
README.md
Search
8/22/2025
Viewing readonly version of main branch: v416
View latest version
README.md

push

Send push notifications from val.town to your device!

Setup

  • πŸ”€ Remix this val
  • Open HTTP Endpoint
  • Create an API key with Users: Read-only permission
  • Paste your API key into the password field
  • Subscribe and allow push notification permissions
  • You should receive a πŸ‘‹ notification!

Usage

Calling push notifications in another val:

Create val
import { sendNotification } from "https://esm.town/v/YOUR_PUSH_REMIX_HERE/pushSendNotification.tsx"; console.log( await sendNotification("Example notification", { data: { url: "https://example.com" }, }), );

Sending a push notification outside of Val Town using an API call:

Create val
fetch("https://YOUR_ENDPOINT_HERE/push", { method: "POST", headers: { "Content-Type": "application/json", Authorization: "Bearer YOUR_API_TOKEN_HERE", }, body: JSON.stringify([ "Example notification", { data: { url: "https://example.com" } }, ]), })
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
Β© 2025 Val Town, Inc.