> For the complete documentation index, see [llms.txt](https://docs.notcentralised.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.notcentralised.com/sdk/register-and-generate-keys.md).

# Register and Generate Keys

Once you've initialised your **NotVault** library as detailed in the previous section, you're now ready to register an account and perform key generation.

To register an account and generate keys in a TypeScript environment, follow the steps below:

1. **Import the necessary libraries**:

   ```typescript
   import { NotVault } from '@notcentralised/notvault-sdk';
   ```
2. **Instantiate the NotVault class**:

   ```typescript
   const vault = new NotVault();
   ```
3. **Register the contact ID and keys**:

   * Use the `.register` method of the `vault` instance to register the account. This method takes in several parameters and callback functions to facilitate the registration process.
   * The parameters for this method include the wallet address, email or 0xWallet, and the secret key.
   * The callback functions include retrieving the public key from the crypto wallet, decrypting with the crypto wallet, and a success callback that logs the public key and contact ID.

   ```typescript
   await vault.register(
       '... Wallet Address ...', 
       '... Email or 0xWallet ...',
       '... Secret Key ...',
       async () => { return '... Public Key ...'; }, // Retrieve public key from crypto wallet    
       async (encryptedPrivateKey: string) => { return '... Private Key ...'; }, // Decrypt with crypt wallet
       async (publicKey: string, contactId: string) => { console.log('Success!', publicKey, contactId); } // Success
   );
   ```

With these steps, your account is registered in **NotVault** and your keys are properly set up for further operations. This registration process is an essential step for successfully using **NotVault** to perform secure and confidential operations on your data and tokens.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.notcentralised.com/sdk/register-and-generate-keys.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
