nostriphant/client

Simple Nostr client

Maintainers

Package info

github.com/nostriphant/client

pkg:composer/nostriphant/client

Statistics

Installs: 1 014

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

2.0.1 2026-06-23 12:04 UTC

This package is auto-updated.

Last update: 2026-06-23 15:09:07 UTC


README

Simple nostr php client

<?php

use nostriphant\Client\Client;

$client = Client::connectToUrl("wss://nos.lol", "wss://relay.damus.io");

$client(function(callable $send, callable $subscribe) {
    $subscription = $subscribe(ids: ['hex_event_id']);
    $subscription(function(?\nostriphant\NIP01\Event $event, callable $close, callable $stop) {
        if (is_null($event)) {
            // EOSE
        } else {
            // EVENT RECEIVED
        }
    });

    $event = new \nostriphant\NIP01\Event(...);
    $send($event, function(bool $accepted, string $reason, callable $stop) {
        // handle response
    });
});