> ## Documentation Index
> Fetch the complete documentation index at: https://gleanfeed.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Configure the widget

> Choose the widget mode, starting view, launcher appearance, and lifecycle methods.

Use the dashboard-generated snippet for the default launcher. Initialize `window.GleanFeed` manually when your app needs explicit configuration or lifecycle control.

## Initialize manually

```html theme={null}
<script src="https://cdn.gleanfeed.com/widget.js"></script>
<script>
  window.GleanFeed.init({
    workspace: "acme",
    portalBaseUrl: "https://gleanfeed.com",
    mode: "launcher",
    defaultView: "feedback",
  });
</script>
```

Calling `init()` destroys the previous widget instance before mounting the new one. This makes reinitialization safe when a single-page app changes workspace or customer context.

## Initialization options

| Option          | Required                    | Behavior                                                                                                                |
| --------------- | --------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| `workspace`     | Yes                         | Workspace slug used to build portal URLs.                                                                               |
| `workspaceId`   | For signed identity         | Workspace UUID used by `identify()` and signed notification requests.                                                   |
| `user`          | No                          | Server-signed customer object. See [Identify customers](/widget/identity).                                              |
| `mode`          | No                          | `launcher` or `inline`. Any value other than `inline` uses launcher mode.                                               |
| `defaultView`   | No                          | `feedback`, `roadmap`, or `changelog`. When omitted, the portal overview opens.                                         |
| `accentColor`   | No                          | Launcher background color. An explicit value overrides the remote workspace setting.                                    |
| `buttonIcon`    | No                          | Launcher icon. An explicit value overrides the remote workspace setting.                                                |
| `portalBaseUrl` | For manual production setup | Glean Feed application origin. The generated snippet supplies it; the script can also infer it from standard CDN hosts. |

Remote launcher settings are fetched only in launcher mode. If `accentColor` or `buttonIcon` is omitted, the widget uses the workspace setting when available. If remote settings cannot load, the accent falls back to Glean blue and the icon falls back to `megaphone`.

## Launcher icons

`buttonIcon` accepts `megaphone`, `pencil`, `chat`, `feedback`, `idea`, `question`, `note`, or `help`. An unsupported value becomes `megaphone`.

## Open, close, and change views

```js theme={null}
window.GleanFeed.open();
window.GleanFeed.open("feedback");
window.GleanFeed.open("roadmap");
window.GleanFeed.open("changelog");
window.GleanFeed.close();
```

Launcher mode loads its iframe the first time it opens. Passing a view changes the embedded route. `close()` hides the launcher panel; it does not destroy the instance. In inline mode, `open()` can change the view but there is no panel to show or hide.

## Update identity or remove the widget

```js theme={null}
await window.GleanFeed.identify(signedCustomer);
window.GleanFeed.destroy();
```

`identify()` exchanges a server-signed customer identity for an embedded portal session. `destroy()` removes the iframe, launcher, panel, badge beacon, polling, and event listeners.

## React wrapper

There is no public React package to install today. React apps should load `widget.js` once and call the same `window.GleanFeed` methods from event handlers or effects. Keep the script outside frequently remounted component trees, call `destroy()` during application-level cleanup when needed, and use the shared [signed identity](/widget/identity) flow for logged-in customers.
