# getUserToken

Learn how to get the visitor's user token.

This method provides the user token of the current session.

The token is anonymous unless the visitor has been [identified](identify).

## Signature

This method has the following signature:

```php
public function getUserToken(): Token
```

This method returns a [`Token`](../../authentication/token) that represents the visitor's session as a [JSON Web Token (JWT)](https://jwt.io).

## Example

Here is a basic example of how to use this method:

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

$croct = Croct::fromDotenv();
$token = $croct->getUserToken();
```
