@bitmacro/relay-connect
v0.1.2
Published
Nostr NIP-46 (Nostr Connect) and NIP-07 helpers for BitMacro Relay Manager and other clients
Maintainers
Readme
@bitmacro/relay-connect

→ Connect UI: relay-connect-web
→ BitMacro: bitmacro.io
BitMacro Connect is the product name; the npm package is @bitmacro/relay-connect. TypeScript SDK for NIP-46 (Nostr Connect) and NIP-07 used with BitMacro Relay Manager: relay-api /signer, optional relay-agent, and browser extensions.
Reference app (Next.js): relay-connect-web
| Package | Role |
| -------------------- | ----------------------------------------- |
| @bitmacro/relay-connect | This repo — reusable client logic |
| relay-connect-web | Minimal UI + Next.js proxy to relay-api |
| relay-api | Central hub (private in production) |
Status
Public API grows as logic is extracted from relay-connect-web and consumers like relay-panel.
Install
npm install @bitmacro/relay-connectUsage
import {
RELAY_CONNECT_PRODUCT_NAME,
RELAY_CONNECT_VERSION,
relayConnectLog,
setRelayConnectLogSink,
} from "@bitmacro/relay-connect";
console.log(RELAY_CONNECT_PRODUCT_NAME, RELAY_CONNECT_VERSION); // BitMacro Connect — marketing nameLogs → host app (browser or Node)
The SDK does not assume console. Register a sink once; your UI can append entries to state, forward to analytics, or print:
import {
relayConnectLog,
setRelayConnectLogSink,
type RelayConnectLogEntry,
} from "@bitmacro/relay-connect";
setRelayConnectLogSink((entry: RelayConnectLogEntry) => {
// entry.product === "BitMacro Connect"
// entry.package === "@bitmacro/relay-connect"
myPanel.push(entry);
});
relayConnectLog("info", "Custom flow step", { step: "pairing" });Optional second argument: setRelayConnectLogSink(sink, { minLevel: "warn" }). Call setRelayConnectLogSink(null) to detach.
Development
npm install
npm run typecheck
npm run buildLicense
MIT — see LICENSE.
