Skip to content

Instantly share code, notes, and snippets.

@jiftechnify
Created February 9, 2024 23:35
Show Gist options
  • Save jiftechnify/b95ebb8e839eb89fc26cbf4f540715f0 to your computer and use it in GitHub Desktop.
Save jiftechnify/b95ebb8e839eb89fc26cbf4f540715f0 to your computer and use it in GitHub Desktop.
minimum Nostr client
const minNostrClient = () => {
const ws = new WebSocket("wss://yabu.me");
ws.onopen = () => {
ws.send(JSON.stringify(["REQ", "sub", { "kinds": [1], "limit": 10 }]));
}
ws.onmessage = (e) => {
console.log(JSON.parse(e.data)[2].content);
}
}
minNostrClient();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment