# 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: 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:

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

The question should be specific, self-contained, and written in natural language.
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.
