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

# openWidget

> Open the widget and display options

## openWidget

The `openWidget` function opens the widget and displays linking options to the tenant.

### Parameters:

* **tenantId**: `string?`
  * A string identifier for the tenant. If the `tenantId` is set during initialization, this parameter becomes optional.

We recommend setting the `tenantId` at initialization time in order to prefetch the tenant's information.

### Example:

```javascript theme={null}
// Initialize without pre-configured tenant
const hotglue = new Hotglue({
    environmentId: '<ENV ID>',
    apiKey: '<PUBLIC API KEY>'
});
hotglue.openWidget('exampleTenantId');


const hotglue = new Hotglue({
    tenantId: 'preConfiguredTenantId',
    environmentId: '<ENV ID>',
    apiKey: '<PUBLIC API KEY>'
});
hotglue.openWidget();
```
