Configuration

The optional createNsiteSDK(options) facade accepts a shared configuration object. Individual modules also work directly.

interface SDKOptions {
  relays?: string[];
  server?: string;
  signer?: Signer;
  storage?: StorageAdapter;
  Socket?: WebSocketConstructor;
  fetcher?: typeof fetch;
  clock?: () => number;
}
import { Core, createNsiteSDK } from '@chaoticka/nsite-loopy-sdk';

const options = Core.normalizeOptions({
  relays: ['wss://relay.example.net'],
  server: 'https://blossom.example.net',
});
const sdk = createNsiteSDK(options);
  • relays: explicit fallback or discovered event relays; NIP-65 routing is an independent step.
  • server: Blossom HTTPS endpoint; do not confuse with a WebSocket relay.
  • signer: user-authorized NIP-07 or NIP-46 signer, or an Android host adapter.
  • storage: async get, set, delete, keys contract.
  • Socket, fetcher: injected transports to facilitate host integration and offline testing.
  • clock: deterministic seconds source for testing.

For the full source document, see Runtime options and Facade API.