Quickstart
Send your first web push notification in 5 minutes
Create your account
Sign up at pushary.com/sign-up. During onboarding, you'll get your site key and API key.
- Site key (
pk_xxx): used in the browser, safe to expose - Full API key (
pk_xxx.sk_xxx): used on your server, keep secret
Install the Client SDK
npm install @pushary/sdkAdd the service worker file to your site's public root. Download it from your dashboard or copy it from node_modules/@pushary/sdk/dist/pushary-sw.js to your public/ directory.
Initialize in your frontend
import { createPushary } from '@pushary/sdk'
const pushary = createPushary({
siteKey: 'pk_your_site_key',
autoPrompt: true,
})This registers the service worker and prompts visitors for notification permission.
Install the Server SDK
npm install @pushary/serverimport { createPusharyServer } from '@pushary/server'
const pushary = createPusharyServer({
apiKey: process.env.PUSHARY_API_KEY,
})Send your first notification
await pushary.notifications.send({
title: 'Hello!',
body: 'Your first push notification from Pushary',
})Passing no targeting parameters sends to all active subscribers. To target specific users, pass subscriberIds, externalIds, or tags.
Verify it arrived
Open your site in a browser where you've allowed notifications. You should see the push within 2 seconds.
If it doesn't arrive, check Troubleshooting.
Next: go deeper
- Client SDK API Reference: all configuration options and methods
- Authentication: site keys vs full API keys
- Campaigns: schedule and target notifications
- Flows: automated sequences (welcome series, re-engagement)
- WordPress integration: 2-minute setup for WordPress sites