
Security News
Deno 2.6 + Socket: Supply Chain Defense In Your CLI
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.
@nostr-dev-kit/ndk
Advanced tools
NDK - Nostr Development Kit. Includes AI Guardrails to catch common mistakes during development.
NDK (Nostr Development Kit) is a TypeScript/JavaScript library that simplifies building Nostr clients, relays, and related applications.
If you're new to NDK or using an AI assistant, enable AI Guardrails:
const ndk = new NDK({ aiGuardrails: true });
This prevents 90% of common mistakes (bech32 in filters, missing fields, invalid formats) with clear error messages. Disable in production.
NDK includes AI Guardrails - runtime validation that catches common mistakes:
Enable with aiGuardrails: true - see Quick Start below.
npm install @nostr-dev-kit/ndk
# or
yarn add @nostr-dev-kit/ndk
# or
bun add @nostr-dev-kit/ndk
import NDK, { NDKEvent, NDKPrivateKeySigner } from '@nostr-dev-kit/ndk';
async function main() {
const signer = NDKPrivateKeySigner.generate();
const ndk = new NDK({
explicitRelayUrls: ['wss://relay.primal.net'],
signer,
// ⚠️ STRONGLY RECOMMENDED: Enable during development
// Catches common mistakes before they cause silent failures
aiGuardrails: true
});
// Connect to relays
await ndk.connect();
// Publish a simple text note
const event = new NDKEvent(ndk, {
kind: 1,
content: 'Hello Nostr via NDK!',
})
await event.sign();
event.publish();
// subscribe to all event interactions
ndk.subscribe(event.filter(), { closeOnEose: false }, {
onEvent: (replyEvent: NDKEvent) => console.log(replyEvent.author.npub, "interacted with our hello world with a kind", replyEvent.kind);
})
// Subscribe to incoming text notes
const subscription = ndk.subscribe(
{ kinds: [1] },
{ closeOnEose: true },
{
onEvent: (evt) => console.log('Received event:', evt),
onEose: () => console.log('End of stream'),
}
);
}
main().catch(console.error);
Full API reference and guides are available at https://nostr-dev-kit.github.io/ndk.
MIT
FAQs
NDK - Nostr Development Kit. Includes AI Guardrails to catch common mistakes during development.
The npm package @nostr-dev-kit/ndk receives a total of 4,772 weekly downloads. As such, @nostr-dev-kit/ndk popularity was classified as popular.
We found that @nostr-dev-kit/ndk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.