# Registering domains for SDK integration

> Register all required domains for proper SDK functionality across environments.

Source: https://docs.grovs.io/docs/how-to-guides/web/register-domains

Register every origin the Web SDK runs on, including local development and staging. An origin is the scheme, host and port, such as `https://app.example.com` or `http://localhost:3000`.

On every authentication, the backend compares the page's origin **exactly** against your project's linked domains. An unlisted origin is rejected with "This Web app is not configured".

> **Warning:** Register localhost URLs too. The SDK fails on any origin you leave out.

### 1. List every origin

List each environment where the site runs or is tested, with its scheme and port:

```text
# Production
https://www.example.com

# Test
https://test.example.com

# Staging
https://staging.example.com

# Development
http://localhost:8080
http://localhost:3000
```

### 2. Add each origin in the dashboard

In your project's domain registration section, add each origin exactly as the browser reports it: same scheme, same host, and the port when it isn't the default. `https://example.com` and `https://www.example.com` are different origins, as are `http://localhost:3000` and `http://localhost:5173`.

### 3. Verify each origin

Load the site in each environment with info logging on. `configure` should resolve `true`:

```javascript
const ready = await Grovs.configure({
  apiKey: 'your-api-key',
  debugLevel: 'info',
  onError: (code, message) => console.error(code, message),
});
console.log('Grovs configured:', ready);
```

If it resolves `false` with an `authenticationFailed` error saying the web app is not configured, the message includes the exact origin the SDK sent. Copy it into the dashboard instead of retyping it.

> **Note:** Register a new environment's origin before you deploy to it.
