@norionsoft/qr-vault-cloud-github
v0.1.0
Published
GitHub Gist adapter for @norionsoft/qr-vault — store encrypted backups as secret gists
Downloads
128
Readme
@norionsoft/qr-vault-cloud-github
GitHub Gist adapter for @norionsoft/qr-vault — store encrypted wallet backups as secret gists.
Installation
npm install @norionsoft/qr-vault @norionsoft/qr-vault-cloud-githubQuick Start
import { Vault } from '@norionsoft/qr-vault';
import { GitHubGistAdapter } from '@norionsoft/qr-vault-cloud-github';
const adapter = new GitHubGistAdapter({
token: 'ghp_xxx...', // PAT or OAuth token with 'gist' scope
});
const vault = new Vault({ adapter });
await vault.put({
payload: 'U2FsdGVkX1/...',
meta: { label: 'GitHub Backup', chains: ['eth'] },
});
const entries = await vault.list();API Reference
GitHubGistAdapter
new GitHubGistAdapter({
token: string, // PAT or OAuth token with 'gist' scope
descriptionPrefix?: string, // default: '[qr-vault]'
});Required Token Scopes
gist— Create, read, update, delete gists
Storage Layout
- One secret gist per vault entry
- Gist description:
[qr-vault] <entry-id> - Single file per gist:
qrvault.json - Gist id stored in
entry.meta.__githubGistIdfor efficient updates
Error Handling
| HTTP Status | AdapterError cause |
|-------------|-------------------|
| 401/403 | 'unauthorized' |
| 404 on get | Returns null |
| 5xx | 'transient' |
| Network failure | 'network' |
Security Note
- All gists are created as secret (not public)
- If a gist is found to be public, it is skipped with a
console.warn - Only encrypted blobs are stored — no plaintext ever
Compatibility
- Modern browsers with
fetchsupport - Node.js >= 18
License
MIT — Norionsoft
