Skip to content

Add unseal example and docs for already-initialized vaults#295

Merged
aviadhahami merged 2 commits intomasterfrom
copilot/how-to-unseal-a-vault
Mar 21, 2026
Merged

Add unseal example and docs for already-initialized vaults#295
aviadhahami merged 2 commits intomasterfrom
copilot/how-to-unseal-a-vault

Conversation

Copy link
Contributor

Copilot AI commented Mar 21, 2026

Users had no guidance on how to unseal a vault that was already initialized — the existing example/init.js only covers the combined init+unseal flow.

  • example/unseal.js: Standalone example reading UNSEAL_KEY from env, consistent with other examples
  • README.md: New section covering single-key and multi-key (threshold > 1) unseal scenarios
// single key
vault.unseal({ key: 'my-unseal-key' })
  .then(console.log)
  .catch(console.error);

// threshold > 1: call unseal repeatedly, checking result.sealed and result.progress
vault.unseal({ key: 'first-key' })
  .then((result) => {
    console.log('Progress:', result.progress + '/' + result.t);
    return vault.unseal({ key: 'second-key' });
  });
Original prompt

This section details on the original issue you should resolve

<issue_title>How to unseal a vault that is already initialized?</issue_title>
<issue_description>Basic question. I don't see any examples on handling this scenario.
Thanks</issue_description>

Comments on the Issue (you are @copilot in this section)


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Copilot AI changed the title [WIP] Add examples for unsealing an initialized vault Add unseal example and docs for already-initialized vaults Mar 21, 2026
Copilot AI requested a review from aviadhahami March 21, 2026 23:21
@aviadhahami aviadhahami marked this pull request as ready for review March 21, 2026 23:27
@aviadhahami aviadhahami merged commit bd429e8 into master Mar 21, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to unseal a vault that is already initialized?

2 participants