# Register using SDK

The `delegateRegisterAccount` method is your entry to Passport Protocol. The `delegateRegisterAccount` method generates a key, using a unique email/username under your scope, you can read more about scopes and how to [configure your scope](https://docs.0xpass.io/authentication/configuring-your-scope).

To use the `delegateRegisterAccount` method you'll have to instantiate an instance of `Passport` from the SDK and simply call the register function with the relevant parameters

{% hint style="info" %}
Private key used for KeySigner can be generated by following[generating-doa-keys](https://docs.0xpass.io/appendix/generating-doa-keys "mention")
{% endhint %}

```typescript
import { Passport } from "@0xpass/passport";
import { KeySigner } from "@0xpass/key-signer";

const signer = new KeySigner(process.env.PRIVATE_KEY!, true);

const passport = new Passport({
    scope_id: "insert_your_scope_id",
    signer: signer
});

const userInput {
   username: "johndoe@somemail.com"
}

await passport.setupEncryption(); 
await passport.delegatedRegisterAccount(userInput);
```

Here we set up a `Passport` instance and a `KeySigner` we use to sign the obtain the signature from your DOA. We also set up a userInput, which contains a unique `username` attached to your scope, and a `userDisplayName` which allows users to chose how they'd like their passkey to be saved. The `setupEncryption` method is called to create a secure channel of communication with the protocol.<br>

### registration parameters

<table><thead><tr><th width="247">Parameter</th><th width="218">Description</th><th>Example Value</th></tr></thead><tbody><tr><td>username</td><td>username is identifier which we use to uniquely identify user. It may have any value like email, phone number, random string, but it must be unique</td><td><code>johndoe@somemail.com</code></td></tr></tbody></table>

#### registration Response

A successful response will return the following, an `account_id` and corresponding `identifier_hash`

```json
{
    "jsonrpc": "2.0",
    "result": {
        "account_id": "account_id_here",
        "identifier_hash": "identifier_hash_here"
    },
    "id": 1
}
```
