> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trypillow.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Identification

> Identify browser users and set durable properties with the Pillow web SDK

Use identification to attach Pillow audience data to your website users. For the concepts behind this, see [About identification](/sdk/concepts/identification).

These methods are available on the SDK instance you initialize from `@trypillow/web`.

## Set an external ID

Call `setExternalId(...)` after login or whenever you know who the current user is.

```ts theme={"theme":{"light":"github-light","dark":"github-dark"}}
sdk.setExternalId('user_123');
```

The SDK persists this ID locally and reuses it across future browser sessions until you call `reset()`.

## Set user properties

Use `setUserProperty(...)` to store traits that you can use for targeting and analysis.

```ts theme={"theme":{"light":"github-light","dark":"github-dark"}}
sdk.setUserProperty('plan', 'pro');
sdk.setUserProperty('email_verified', true);
sdk.setUserProperty('lifetime_value', 49.5);
```

Supported value types:

* `string`
* `boolean`
* `number`

## Remove properties

```ts theme={"theme":{"light":"github-light","dark":"github-dark"}}
sdk.clearUserProperty('legacy_flag');
sdk.clearAllProperties();
```

Clearing properties updates the local browser state. Set new properties again when you want to target the user differently.

## What's next

<CardGroup cols={2}>
  <Card title="Studies" icon="message-square" href="/sdk/web/studies">
    Present hosted studies once the user is identified.
  </Card>

  <Card title="Session management" icon="refresh-cw" href="/sdk/web/session-management">
    Reset identity on logout and manage in-progress sessions.
  </Card>
</CardGroup>
