# Customise the chat widget

The chat widget works out of the box, but you can change how it looks, when it appears and what it knows about the visitor.

## Configure it in code

Set options before the widget script loads:

```html
<script>
  window.relaypointSettings = {
    workspace: 'acme-support',
    position: 'bottom-right',
    greeting: 'Hi! How can we help?',
    hideOnPaths: ['/checkout'],
  };
</script>
<script src="https://widget.relaypoint.example/v1.js" async></script>
```

## Identify signed-in users

Pass the visitor's details so agents see who they're talking to. Sign the email on your server so nobody can impersonate a customer:

```php
$hash = hash_hmac('sha256', $user->email, config('services.relaypoint.identity_secret'));
```

```javascript
window.relaypointSettings.user = {
  email: 'alex@example.com',
  name: 'Alex Rivera',
  hash: '<the value from your server>',
};
```

## Options

| Option        | Type                            | Default                 |
| ------------- | ------------------------------- | ----------------------- |
| `position`    | `bottom-right` \| `bottom-left` | `bottom-right`          |
| `greeting`    | string                          | Your workspace greeting |
| `hideOnPaths` | string\[]                       | `[]`                    |
| `openOnLoad`  | boolean                         | `false`                 |

:::warning
Never put the identity secret in front-end code. Compute the hash on your server only.
:::
