Turn a folder of files into a Nostr website

An nsite is a normal website whose files are stored on Blossom and whose address is announced with a signed Nostr event. Loopy prepares the file list and manifest so you can publish, update or recover a site without inventing the process again.

Prepare offline

import { Nsite } from '@chaoticka/nsite-loopy-sdk';
const files = {
  'index.html': '<h1>Hello world</h1>',
  'styles.css': 'body { background: #000000; color: #ffffff }',
};
const prepared = await Nsite.prepareManifestFiles(files);
console.log(prepared.aggregate, prepared.totalBytes);

Publish only with authorization

const result = await Nsite.publishNsite(files, {
  signer, pubkey,
  server: approvedBlossomServer,
  relays: approvedRelays,
  identifier: 'docs',
  title: 'My nsite',
});
console.log(result.manifest, result.receipts);

The pipeline runs prepare → exact-byte uploads → manifest signing → relay publication → signed readback, recording checkpoints. If a gate fails, it throws instead of printing a fake success receipt. No publishing is triggered by reading these docs or importing the package.

For offline plans and exceptions, see Nsite API and Release workflow.