# toString

Learn how to serialize the token to a string.

This method serializes the token to its string representation. The result is the encoded [JSON Web Token (JWT)](https://jwt.io).

## Signature

This method has the following signature:

```php
public function toString(): string
```

This method returns the serialized JWT string.

## Example

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

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

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

$serialized = $token->toString();
```
