nostriphant/client

Simple Nostr client

Installs: 163

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

Type:project

pkg:composer/nostriphant/client

0.3.1 2025-10-21 11:35 UTC

This package is auto-updated.

Last update: 2025-10-21 13:32:44 UTC


README

Simple nostr php client

<?php

use nostriphant\NIP01\Message;
use nostriphant\Client\Client;

$client = Client::connectToUrl("wss://nos.lol");

$listen = $client(function(\nostriphant\NIP01\Transmission $send) {
    // connection has been established, start communicating here
    $send(Message::event(new \nostriphant\NIP59\Rumor(time(), 'pubkey', 1, 'Hello World!', [])));
});

listen(function(\nostriphant\NIP01\Message $message, callable $stop) {
    // code to handle incoming messages

    $stop(); // stops listening
});

$listen(fn(int $signal) =>  printf("Received signal %d, stopping client", $signal));