> 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/appmixer-ui-sdk/constructor.md).

# Untitled

Appmixer Constructor lays a foundation for building user interfaces with widgets.

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

Set up a new `appmixer` instance with configuration parameters passed directly into the constructor or use the `set`/`get` methods:

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

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

#### **`baseUrl`**

Type: `String` | Default: `null`

Base URL of your Appmixer engine REST API.

#### **`accessToken`**

Type: `String` | Default: `null`

Access token of an authorized user.

#### **`externalUserId`** <a href="#externaluserid" id="externaluserid"></a>

Type: `String` | Default: `null`

The person on your side who is acting, recorded in the audit log. When one Appmixer user stands for many people in your organization, set it to the ID of whoever is signed in on your side: every change made through the SDK, the Designer and the AI Copilot included, is recorded with it as `externalUserId`, and [`GET /system/audits`](/api/audit-logs.md) can filter by it. The SDK sends it as the `X-Appmixer-Audit-External-User-Id` request header, to your Appmixer API only. Change it with `appmixer.set('externalUserId', id)` whenever a different person signs in; `null` clears it, and nothing is sent while it is not set.

Use an opaque ID from your own user management, never a name or an email address: the value is stored as it is, exported in the audit log CSV and kept until audit log entries [expire](/api/audit-logs.md#retention). It is your claim, not a credential: attribution, not authentication.

The audit log records IDs of up to 128 characters made of letters, digits, `.`, `_` and `-`. For any other value the SDK emits a [`warning`](/appmixer-ui-sdk/api-module.md#events) event (printed with `debug: true`) and sends it all the same, except a value a request header cannot carry unchanged (a character beyond Latin-1, a control character, leading or trailing whitespace), which it does not send at all.

#### **`debug`**

Type: `Boolean` | Default: `false`

Enable debugger for development purposes.

#### **`theme`**

Type: `Object` | Default: `DefaultTheme`

#### **`l10n`**

Type: `Object` | Default: `DefaultL10N`

Define custom localization texts. See [Custom Strings](/customizing-embedded-ui/custom-strings.md) for the structure of the object and how overrides are resolved.

#### **`lang`**

Type: `String` | Default: `en`

Specify a language code for the localization of components.

#### **`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.


---

# 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/appmixer-ui-sdk/constructor.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.
