Skip to main content
Home

latest

Framework for Nostr on Deno and web. 🛸

This package works with Deno, BrowsersIt is unknown whether this package works with Cloudflare Workers, Node.js, Bun
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Node.js
This package works with Deno
It is unknown whether this package works with Bun
This package works with Browsers
JSR Score
94%
Published
4 days ago (0.46.4)
class NSecSigner
implements NostrSigner

NIP-07-compatible signer with secret key. It is a drop-in replacement for window.nostr.

Usage:

const signer = new NSecSigner(secretKey);
const pubkey = await signer.getPublicKey();
const event = await signer.signEvent({ kind: 1, content: 'Hello, world!', tags: [], created_at: 0 });

Constructors

new
NSecSigner(secretKey: Uint8Array)

Properties

readonly
nip04: { encrypt: (
pubkey: string,
plaintext: string,
) => Promise<string>
; decrypt: (
pubkey: string,
ciphertext: string,
) => Promise<string>
; }
readonly
nip44: { encrypt: (
pubkey: string,
plaintext: string,
) => Promise<string>
; decrypt: (
pubkey: string,
ciphertext: string,
) => Promise<string>
; }
private
abstract
pubkey: string

Methods

signEvent(event: Omit<NostrEvent,
"id"
| "pubkey"
| "sig"
>
): Promise<NostrEvent>

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@nostrify/nostrify

Import symbol

import { NSecSigner } from "@nostrify/nostrify";
or

Import directly with a jsr specifier

import { NSecSigner } from "jsr:@nostrify/nostrify";

Add Package

pnpm i jsr:@nostrify/nostrify
or (using pnpm 10.8 or older)
pnpm dlx jsr add @nostrify/nostrify

Import symbol

import { NSecSigner } from "@nostrify/nostrify";

Add Package

yarn add jsr:@nostrify/nostrify
or (using Yarn 4.8 or older)
yarn dlx jsr add @nostrify/nostrify

Import symbol

import { NSecSigner } from "@nostrify/nostrify";

Add Package

vlt install jsr:@nostrify/nostrify

Import symbol

import { NSecSigner } from "@nostrify/nostrify";

Add Package

npx jsr add @nostrify/nostrify

Import symbol

import { NSecSigner } from "@nostrify/nostrify";

Add Package

bunx jsr add @nostrify/nostrify

Import symbol

import { NSecSigner } from "@nostrify/nostrify";