
Security News
Happy Birthday, Shai-Hulud
It has been one year since Shai-Hulud made its first appearance on npm.
A minimal Node.js SDK for interacting with the Nostr protocol.
npm install nostr-sdk
const nostr = require("nostr-sdk");
posttoNostr(message, options = {})
message: The text to post.options: { tags, relays, powDifficulty, privateKey/nsec }getmessage(onMessage, options = {})
onMessage: Callback for each received message.options: { relays, privateKey/nsec, since }sendmessage(recipientPubkey, message, options = {})
recipientPubkey: Recipient's public key (hex or npub).message: The message to send.options: { relays, privateKey/nsec }getMessageNIP17(onMessage, options = {})
onMessage: Callback for each received message.options: { relays, privateKey/nsec, since }sendMessageNIP17(recipientPubkey, message, options = {})
recipientPubkey: Recipient's public key (hex or npub).message: The message to send.options: { relays, privateKey/nsec }replyToPost(eventId, message, authorPubkey, options = {})
eventId: The event ID to reply to (hex or note format).message: The reply message.authorPubkey: The public key of the original post author (hex or npub format).options: { tags, relays, powDifficulty, privateKey/nsec }getGlobalFeed(options = {})
options: { limit, since, until, kinds, authors, relays }generateRandomNsec()
nsecToPublic(nsec)
nsec: Private key in nsec1... format.{ publicKey, npub }Recommendation: Use NIP-17 (sendMessageNIP17 / getMessageNIP17) for new applications. Keep NIP-4 support for backward compatibility.
import { NostrSDK } from 'nostr-sdk';
const client = new NostrSDK({
nsec: 'nsec1...your-private-key',
});
// Send a private gift-wrapped message
await client.sendMessageNIP17(
'npub1...recipient',
'This is a private NIP-17 message!'
);
// Listen for incoming NIP-17 messages
const unsubscribe = client.getMessageNIP17(async (message) => {
console.log('From:', message.senderNpub);
console.log('Message:', message.content);
});
// Clean up when done
// unsubscribe();
// client.destroy();
See example-nip17.js for more examples.
FAQs
nostr sdk
We found that nostr-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
It has been one year since Shai-Hulud made its first appearance on npm.

Research
/Security News
Operators behind PolinRider used a compromised GitHub account to plant malware in four development versions of a Packagist package with 700,000+ downloads.

Security News
GitHub Actions now supports cache-mode, a least-privilege control on the Actions cache aimed at the cache poisoning technique behind recent compromises.