SDK shortcuts

A convenient starting point when you want several Loopy features to share the same signer, relays and other options.

Try it in context: Read the guide.

import {createNsiteSDK} from '@chaoticka/nsite-loopy-sdk';
const sdk = createNsiteSDK({relays: ['wss://relay.example.net']});

relay.example.net is a documentation placeholder, not a live relay.

What you can call (3)

createNsiteSDK

Set up one convenient object with the library modules and shared configuration.

Call it as: facade.createNsiteSDK

For developers: TypeScript signature

function createNsiteSDK(options?: SDKOptions): NsiteSDK;

publish

Publish website files using the configured signer, relays and Blossom server.

Call it as: facade.publish

For developers: TypeScript signature

sdk.publish(files: FileMap, overrides?: object): Promise<PublishedNsite>;

query

Fetch matching Nostr events using the configured relay choices.

Call it as: facade.query

For developers: TypeScript signature

sdk.query(filter: object, overrides?: object): Promise<SignedEvent[]>;