# getPlugOptions

Learn how to get the options to set up the client-side SDK.

This method provides the options needed to set up the [JavaScript SDK](/reference/sdk/javascript) in the browser, such as the application ID and cookie configuration.

These options configure the client-side SDK to work transparently with the same visitor session started on the server. For more information, see [Client-side setup](/reference/sdk/php/client-side-setup).

## Signature

This method has the following signature:

```php
public function getPlugOptions(): array
```

This method returns an array of options used to configure the client-side SDK.

## Example

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

**index.php**

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

$croct = Croct::fromDotenv();
Croct::emitCookies();
?>
<script src="https://cdn.croct.io/js/v1/lib/plug.js"></script>
<script>croct.plug(<?= json_encode($croct->getPlugOptions()) ?>);</script>
```
