A lightweight, framework-agnostic library for social proof notifications
Using with Local Data
const notifier = SocialProofNotification.create({
dataSource: 'local',
localData: [
{
message: '5 people bought this in the last hour!',
timestamp: '2 minutes ago'
},
{
message: 'John from New York just signed up!',
timestamp: 'Just now'
},
{
message: '10 people are viewing this right now',
timestamp: '30 seconds ago'
}
]
});
notifier.init();
Using with API
// Your API should return:
// { "message": "Someone just bought this!", "timestamp": "Just now" }
const notifier = SocialProofNotification.create({
dataSource: 'api',
apiUrl: 'https://your-api.com/notifications',
initialDelay: 5000,
autoCloseTimeout: 10000
});
notifier.init();