> For the complete documentation index, see [llms.txt](https://docs.appmixer.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.appmixer.com/6.0/6.4/appmixer-ui-sdk/ui-and-widgets/wizard.md).

# Wizard

Manage a flow that is used as an integration instance.

<figure><img src="https://content.gitbook.com/content/vFXzdRN8pEVkEDSMo1qe/blobs/eMn9BT8pdj7VO0BnbBHM/wizard-light.png" alt=""><figcaption><p>Wizard</p></figcaption></figure>

## Configuration <a href="#configuration" id="configuration"></a>

Set up a new instance with `config` parameters and `set`/`get` methods:

```javascript
const wizard = appmixer.ui.Wizard(config)

wizard.set(key, value)
wizard.get(key)
```

#### **`config.el`** **`...`**

{% hint style="info" %}
Learn about `widgetconfig` [here](/6.0/6.4/appmixer-ui-sdk/ui-and-widgets.md#configuration).
{% endhint %}

#### **`config.flowId`**

Type: `String` | Default: `null`

The ID of a flow that is opened in the wizard.

## Instance <a href="#state" id="state"></a>

{% hint style="info" %}
Learn about `widget` instance [here](/6.0/6.4/appmixer-ui-sdk/ui-and-widgets.md#instance).
{% endhint %}

### State

```javascript
wizard.state(name, value)
```

#### **`loader`**

Type: `Boolean` | Default: `null`

Toggle a custom loading state.

#### **`error`**

Type: `String` | Default: `null`

Toggle a custom error message.

### Events <a href="#events" id="events"></a>

```javascript
wizard.on(event, handler)
```

#### **`flow:start`**

```javascript
wizard.on('flow:start', flowId => {/* ... */})
```

Submit the form and start the flow.

#### **`flow:validation`**

```javascript
wizard.on('flow:validation', errors => {/* ... */})
```

Flow validation errors changed.

#### **`cancel`**

```javascript
wizard.on('cancel', () => {/* ... */})
```

Click a button to close the form.

#### `close`

```javascript
wizard.on('close', () => {/* ... */})
```

Submit the form and wait for the flow to start.

## Example

```javascript
const wizard = appmixer.ui.Wizard({
    el: '#wizard',
    flowId: 'your-integration-id'
})

wizard.on('flow:start', async flowId => {
    await appmixer.api.startFlow(flowId)
    wizard.close()
})

wizard.open()
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.appmixer.com/6.0/6.4/appmixer-ui-sdk/ui-and-widgets/wizard.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
