# Constructor

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

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

```javascript
const appmixer = new Appmixer({/* [name]: value */})

appmixer.set(name, value)
appmixer.get(name)
```

#### **`config.baseUrl`**

Type: `String` | Default: `null`

Base URL of your Appmixer engine REST API.

#### **`config.accessToken`**

Type: `String` | Default: `null`

Access token of an authorized user.

#### **`config.debug`**

Type: `Boolean` | Default: `false`

Enable debugger for development purposes.

#### **`config.theme`**

Type: `Object` | Default: `DefaultTheme`

#### **`config.l10n`**

Type: `Object` | Default: `DefaultL10N`

Define custom localization texts.

#### **`config.lang`**

Type: `String` | Default: `en`

Specify a language code for the localization of components.

#### **`config.api`**

Type: `Object` | Default: `{}`

Set custom API methods.

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

#### **`appmixer.ui`**

```javascript
appmixer.ui('Widget', {/* ... */})
appmixer.ui.Widget({/* ... */})
```

Register and create UI Widgets.

#### **`appmixer.api`**

Use methods of built-in API Module.

#### **`appmixer.set`**

```javascript
appmixer.set(key, value)
```

Set configuration property.

#### **`appmixer.get`**

```javascript
appmixer.get(key, value)
```

Get configuration property.

#### **`appmixer.registerCustomComponentShape`**

```javascript
appmixer.registerCustomComponentShape(name, shape)
```

Register a custom **Designer** component shape.

#### **`appmixer.registerInspectorField`**

```javascript
appmixer.registerInspectorField(type, Field, options)
```

Register a custom **Designer** inspector field.

## Basic Usage <a href="#basic-usage" id="basic-usage"></a>

Connect to Appmixer engine REST API and render user interfaces with a built-in widget:

```html
<html lang="en">
<head>
  <meta charset="UTF-8">
  <script src="https://my.YOURTENANT.appmixer.cloud/appmixer/appmixer.js"></script>
</head>
<body>
  <div id="your-widget"></div>

  <script async type="module">
    const appmixer = new Appmixer({ baseUrl: BASE_URL })

    const auth = await appmixer.api.signupUser(USERNAME, PASSWORD)
    appmixer.set('accessToken', auth.token)

    appmixer.ui.FlowManager({ el: '#your-widget' }).open()
  </script>
</body>
</html>
```

{% hint style="info" %}
Change `USERNAME` and `PASSWORD` parameters to valid credentials for registration of a new user.
{% endhint %}

<figure><img src="/files/RzJlxv5raeQtXnYyXwlk" alt=""><figcaption><p>Flow Manager</p></figcaption></figure>

Learn more about the basic usage with the **Quick Start** example.


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.appmixer.com/6.0/5.2/appmixer-sdk/constructor.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
