# Overview

Learn how to sync the visitor with your authenticated user.

This interface abstracts how the SDK discovers the authenticated user of your application.

Register an implementation [when you create the SDK](/reference/sdk/php/api/core/croct/plug). The SDK then reconciles the visitor with the resolved user on every request, so you do not have to update the identity manually.

## Usage

Implement the interface to resolve the current user from your authentication system:

```php
<?php
use Croct\Plug\IdentityResolver;

final class SessionIdentityResolver implements IdentityResolver
{
    public function getUserId(): ?string
    {
        return $_SESSION['user_id'] ?? null;
    }
}
```
