Quick Start

Get up and running with Notifs in under 5 minutes. This guide will walk you through setting up your first webhook and sending your first notification.

Step 1: Create an Account

Visit notifs.io/app to create your free account. No credit card required for the free tier.

Step 2: Get Your API Key

Once logged in, navigate to Settings → API Keys and generate a new API key. Keep this key secure - you'll use it to authenticate API requests.

export NOTIFS_API_KEY="notifs_sk_..."

Step 3: Install the SDK

Install the Notifs SDK for your programming language:

TypeScript/JavaScript (Node.js)

npm install @notifs/sdk
# or
yarn add @notifs/sdk

Python (Coming Soon)

# Coming soon
pip install notifs-sdk

Go (Coming Soon)

# Coming soon
go get github.com/notifs/notifs-go

Step 4: Create a Webhook

In the Notifs dashboard, create a new webhook:

  1. Go to WebhooksCreate Webhook
  2. Give it a name (e.g., "Payment Notifications")
  3. Copy the Webhook ID and Webhook Secret
  4. Add services (Email, Slack, SMS) to configure delivery

Step 5: Send Your First Notification

Now you're ready to send your first notification:

import { Notifs } from '@notifs/sdk'

const notifs = new Notifs({
  apiKey: process.env.NOTIFS_API_KEY
})

async function main() {
  try {
    // Get your webhook
    const webhook = await notifs.webhooks.get('your-webhook-id')

    // Send a notification
    const response = await webhook.send({
      title: 'Payment Received',
      message: 'Your payment of $99.00 was successful',
      data: {
        user: 'john@example.com',
        amount: '$99.00',
        invoiceUrl: 'https://yourapp.com/invoices/123'
      }
    })

    console.log('Notification sent:', response.notificationId)
  } catch (error) {
    console.error('Error:', error)
  }
}

main()

Framework Examples

Next.js (App Router)

// app/api/notifications/route.ts
import { Notifs } from '@notifs/sdk'
import { NextResponse } from 'next/server'

const notifs = new Notifs({
  apiKey: process.env.NOTIFS_API_KEY!
})

export async function POST(request: Request) {
  const { title, message, data } = await request.json()

  const webhook = await notifs.webhooks.get('your-webhook-id')
  const response = await webhook.send({ title, message, data })

  return NextResponse.json({ success: true, notificationId: response.notificationId })
}

Express.js

import express from 'express'
import { Notifs } from '@notifs/sdk'

const app = express()
app.use(express.json())

const notifs = new Notifs({
  apiKey: process.env.NOTIFS_API_KEY!
})

// Get webhook once at startup
let webhook: Awaited<ReturnType<typeof notifs.webhooks.get>>

async function initWebhook() {
  webhook = await notifs.webhooks.get('your-webhook-id')
}

app.post('/api/notifications', async (req, res) => {
  try {
    const { title, message, data } = req.body
    const response = await webhook.send({ title, message, data })
    res.json({ success: true, notificationId: response.notificationId })
  } catch (error) {
    res.status(500).json({ error: 'Failed to send notification' })
  }
})

initWebhook().then(() => app.listen(3000))

Python (Coming Soon)

Python SDK is coming soon. For now, use the REST API directly:

import requests
import hmac
import hashlib
import time

def send_notification(webhook_id: str, webhook_secret: str, payload: dict):
    url = f"https://notifs.io/api/webhook/{webhook_id}"
    body = json.dumps(payload)
    timestamp = int(time.time())
    signature = hmac.new(
        webhook_secret.encode(),
        f"{timestamp}.{body}".encode(),
        hashlib.sha256
    ).hexdigest()

    response = requests.post(url, json=payload, headers={
        "Content-Type": "application/json",
        "X-Notifs-Signature": f"t={timestamp},v1={signature}"
    })
    return response.json()

Next Steps

Need Help?

If you run into any issues, reach out to us: