| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Browser-based git sync via Nostr with optional Bitcoin anchoring.
Subscribe to NIP-34 repo state events (kind 30618) and sync git repositories to browser IndexedDB using isomorphic-git.
npm install nostr-git-clientimport { NostrGitClient } from 'nostr-git-client';
const client = new NostrGitClient({
repo: 'https://solid.social/mel/public/myapp',
repoId: 'myapp',
branch: 'main',
relays: ['wss://relay.damus.io', 'wss://nos.lol'],
trusted: ['pubkey-hex...'] // Only sync from trusted publishers
});
client.on('sync', (event) => {
if (event.status === 'complete') {
console.log('Synced to:', event.commit);
}
});
client.connect();
await client.sync();
// Read files from synced repo
const content = await client.readFile('index.html');
const files = await client.listFiles('src');import { NostrGitClient, StateManager } from 'nostr-git-client';
const client = new NostrGitClient({
repo: 'https://solid.social/mel/public/game',
trusted: ['pubkey...']
});
const state = new StateManager({
sync: client,
file: 'state.json',
anchor: {
privkey: 'your-bitcoin-privkey-hex',
network: 'testnet4'
},
onChange: (newState) => {
console.log('State updated:', newState);
}
});
await state.init();
client.connect();
await client.sync();
// Anchor current state to Bitcoin
const anchor = await state.anchor();
console.log('Anchored:', anchor.txid);import { SelfDeploy } from 'nostr-git-client';
// Auto-reload when repo is updated
SelfDeploy.init({
repo: 'https://solid.social/mel/public/myapp',
trusted: ['pubkey...'],
autoReload: true,
onUpdate: (event) => {
console.log('Update detected:', event.commit);
}
});Main client for Nostr-based git sync.
Constructor options:
Methods:
Events:
Manages JSON state with optional Bitcoin anchoring.
Constructor options:
Methods:
Auto-updating pages.
Static methods:
Options:
Optional:
MIT
| Back | FazBrowse Home | New Git URL |