# Set user identification information

### Before you start <a href="#undefined" id="undefined"></a>

How to set user identification information using DFINERY SDK. [SDK integration](https://docs.dfinery.ai/developer-guide/en/undefined-1/web/integration) must be done first.

### Set up <a href="#undefined-1" id="undefined-1"></a>

User identification information can be set using the `Dfinery.setIdentity` and `Dfinery.setIdentities` methods. User identification information is defined in `DFIdentity`, and only defined values ​​can be used.

{% hint style="warning" %}
`EXTERNAL_ID`In this case, it is recommended to use a fixed value as it is used as an important value to distinguish users among user identification information. Please be careful not to include personal information. If `EXTERNAL_ID`personal information such as email address or phone number is included, it is recommended to encrypt it.
{% endhint %}

### User identification information

| Category                   | Detail                |
| -------------------------- | --------------------- |
| `DFIdentity.EXTERNAL_ID`   | User ID               |
| `DFIdentity.EMAIL`         | User Email            |
| `DFIdentity.PHONE_NO`      | User phone number     |
| `DFIdentity.KAKAO_USER_ID` | User Kakao Account ID |
| `DFIdentity.LINE_USER_ID`  | User line account ID  |

### Set by item

```javascript
setIdentity(identity, "IDENTITY_VALUE");
```

Each parameter means:

* `identity`: User identification information key (using the DFIdentity constant)
* `IDENTITY_VALUE`: User identification information value

{% tabs %}
{% tab title="Javascript" %}

```javascript
Dfinery.setIdentity(DFIdentity.EXTERNAL_ID, "TESTID");
```

{% endtab %}
{% endtabs %}

### Set multiple items at once

```javascript
setIdentities(identities);
```

Each parameter means:

* `identities`: Dictionary with keys and values ​​of user identification information

{% tabs %}
{% tab title="Javascript" %}

```javascript
let identities = {};
identities[DFIdentity.EXTERNAL_ID] = "TESTID";
identities[DFIdentity.EMAIL] = "test1234@gmail.com";
identities[DFIdentity.PHONE_NO] = "821012345678";
identities[DFIdentity.KAKAO_USER_ID] = "12d1s21";
Dfinery.setIdentities(identities);
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
For phone numbers, please enter them in the following format: ex) 821012345678, 82212345678
{% endhint %}

### Reset user identification information <a href="#undefined-7" id="undefined-7"></a>

`resetIdentity`Calling this method will clear and initialize any previously stored user identification information.

{% hint style="danger" %}
Please be careful when making calls, as initializing user identification information will interrupt any ongoing event flow and disconnect the terminal from the integrated ID.
{% endhint %}

{% tabs %}
{% tab title="Javascript" %}

```javascript
Dfinery.resetIdentity();
```

{% endtab %}
{% endtabs %}
