FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
Jamesllllllllll
Jamesllllllllllsocial-proof
Show event signups & product purchase toasts
Public
Like
social-proof
Home
Code
9
backend
3
frontend
3
shared
1
.cursorrules
.vtignore
README.md
deno.json
H
index.ts
script.js
Branches
1
Pull requests
Remixes
History
Environment variables
1
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
…
README.md

Social Proof Notification System

Display purchase or event signup toasts on your website.

Features

  • Purchase Notifications - Show recent purchases with customer names and product details
  • Event Signup Notifications - Display signup counts for events
  • Webhook Integration - Send purchases via ThriveCart or Stripe webhooks

Quick Start

Purchase Notifications

Send a webhook to https://your-val.web.val.run/webhook/purchase

Note: The endpoint currently accepts Stripe and ThriveCart webhooks

Add this script to your page with product IDs to show toasts for recent purchases:

<script src="https://your-val.web.val.run/script.js" data-product-ids="productID1,productID2,productID3"> </script>

Event Signup Notifications

Send a webhook to https://your-val.web.val.run/webhook/events/myAwesomeEvent` - replace myAwesomeEvent with your event name

Note: The endpoint ignores the webhook body, it just increments the event signup count by 1

Add this script with your event name to show a toast with current signup count:

<script src="https://your-val.web.run/script.js" data-event-name="myAwesomeEvent" data-event-display-name="My Awesome Event"> </script>

Configuration Options

Data Attributes

AttributeDescriptionDefaultExample
data-product-idsComma-separated product IDs to track-"product1,product2"
data-event-nameName of event to show signup count for-"Free Webinar 2025"
data-event-display-nameCustom display name for the eventAuto-formatted from event name"Amazing Workshop"
data-positionNotification position"bottom-left""top-right"
data-display-durationHow long to show each notification in ms (min 1000, max 30000)5000"6000"
data-interval-delayTime between notifications (ms)10000"5000"
data-max-display-countMax notifications per session10"15"
data-limitNumber of recent purchases to fetch20"50"
data-min-signupsMinimum signups required to show notification1"5"
data-time-period-hoursShow signups from last X hours-"2"
data-time-period-daysShow signups from last X days-"3"
data-link-urlURL to navigate to when toast is clicked-"https://example.com"

Position Options

  • bottom-left (default)
  • bottom-right
  • top-left
  • top-right

Examples

Time Period Filtering

Show signups from a specific time period:

<!-- Show signups from last 2 hours --> <script src="https://your-val.web.val.run/script.js" data-event-name="Free Webinar 2025" data-time-period-hours="2"> </script> <!-- Show signups from last 3 days --> <script src="https://your-val.web.val.run/script.js" data-event-name="Free Webinar 2025" data-time-period-days="3"> </script>

The notification will display text like "In the last 2 hours" or "In the last 3 days".

Events and Purchases Together

<script src="https://your-val.web.val.run/script.js" data-product-ids="product1,product2" data-event-name="Free Webinar 2025" data-min-signups="3" data-link-url="https://example.com/event-signup"> </script>

Clickable Toasts

Make toasts clickable by adding a link URL:

<script src="https://your-val.web.val.run/script.js" data-product-ids="product1,product2" data-link-url="https://example.com/shop"> </script>

Complete Configuration Example

Here's an example with all available data attributes:

<script src="https://your-val.web.val.run/script.js" data-product-ids="course-123,ebook-456" data-event-name="summer-bootcamp-2025" data-event-display-name="Summer Bootcamp 2025" data-position="bottom-right" data-display-duration="5000" data-interval-delay="5000" data-max-display-count="15" data-limit="50" data-min-signups="5" data-time-period-hours="24"> </script>

This configuration will:

  • Track purchases for course-123 and ebook-456
  • Show a one-time signup notification for the "Summer Bootcamp 2025" event
  • Show notifications in the bottom-right corner
  • Display each notification for 5 seconds
  • Show purchase notifications every 5 seconds
  • Show up to 15 notifications per session
  • Fetch up to 50 recent purchases
  • Only show event notification when 5+ people have signed up
  • Show signups from the last 24 hours

Project Structure

├── backend/
│   ├── database.ts          # SQLite database setup and queries
│   ├── README.md            # Backend documentation
│   ├── routes/
│   │   ├── events.ts        # Event signup API endpoints
│   │   └── purchases.ts     # Purchase API endpoints
│   └── webhooks/
│       ├── events.ts        # Event signup webhook handler
│       └── purchase.ts      # Purchase webhook handler
├── frontend/
│   └── index.html           # Demo page
├── shared/
│   └── types.ts             # Shared TypeScript types
├── deno.json                # Deno configuration
├── index.ts                 # Main HTTP handler using Hono
├── script.js                # Embeddable notification script
└── README.md                # This documentation
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.