Alby Developer Guide
User GuideDeveloper Portal
NWC API
NWC API
  • Introduction
    • ❔What is Nostr Wallet Connect?
  • Building Lightning Apps
    • ⛓️NWC HTTP API
      • ℹ️Fetch NWC Info
      • 📢Publish NWC Request
      • ✍️Publish Event
      • 📩Subscribe to Events
      • 🔔Subscribe to NWC Notifications
      • 🔕Delete Subscriptions
      • ↔️Code examples: Creating Requests
    • ⚡NWC JS SDK
  • Building NWC Wallet Services
    • 🗼Alby NWC Relay
Powered by GitBook
LogoLogo

Our content

  • Website
  • Blog
  • GitHub

Follow us

  • Nostr
  • Twitter / X
  • Youtube

Contact us

  • E-mail
  • Community Chat
  • Open Hours

Your bitcoin & nostr companion / from 🐝 with 🧡

On this page

Was this helpful?

  1. Building Lightning Apps
  2. NWC HTTP API

Subscribe to NWC Notifications

POST https://api.getalby.com/nwc/nip47/notifications

Notifies about 23196 kind events (NWC notifications) of the connection pubkey from the wallet service.

Request Body

Name
Type
Description

relayUrl

string

If no relay is provided, it uses the default relay (wss://relay.getalby.com/v1)

webhookUrl*

string

Webhook URL to publish events

walletPubkey*

string

Pubkey of the NWC Wallet Provider

connectionPubkey*

string

Public key of the user (derived from secret in NWC connection string)

Response

{
  "subscription_id": "f370d1fc-x0x0-x0x0-x0x0-8f68fa12f32c",
  "webhookUrl": "https://your.webhook.url"
}

Response to Webhook URL

{
  "id": "a16ycf4a01bcxx........xxxxx",
  "pubkey": "a16y69effexxxx........xxxxx",
  "created_at": 1709033612,
  "kind": 23196,
  "tags": [
      [
          "p",
          "f490f5xxxxx........xxxxx"
      ],
      [
          "e",
          "a41aefxxxxx........xxxxx"
      ]
  ],
  "content": "<encrypted content>",
  "sig": "<signature>"
}

Last updated 11 months ago

Was this helpful?

⛓️
🔔