Getting Started
5 minutes में push notifications integrate करें और अपनी site के visitors को subscribers में बदलें।
1
SDK Script Configure करें
अपनी HTML website के head tags में यह script include करें:
index.html
<script>
window.VipulPushConfig = {
website_id: "YOUR_WEBSITE_ID", // Settings -> API Keys से प्राप्त करें
auto_prompt: true, // Site Load होने पर permissions prompt दिखाएं
prompt_delay: 2000 // 2 seconds delay
};
</script>
<script src="https://cdn.vipulpush.com/sdk/push-sdk.js" async></script>2
Service Worker Deploy करें
Service worker file sw.js को download करके अपनी website के root folder (public directory) में upload करें:
# Location target:
https://yourwebsite.com/sw.js3
First Notification Send करें
Dashboard API keys panel से API Key generate करें और trigger test करें:
Terminal
curl -X POST https://api.vipulpush.com/api/send \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"website_id": "YOUR_WEBSITE_ID",
"title": "Welcome! 🎉",
"body": "Thank you for subscribing to notifications.",
"url": "https://yourwebsite.com/dashboard"
}'