> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.solvimon.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.solvimon.com/_mcp/server.

# Core

`createSolvimonCore` initialises the SDK once with shared configuration, and gives you back the methods to mount any screen or component.

---

## Overview

Call `createSolvimonCore` once, typically at app initialisation, and reuse the returned instance across your app. The shared config you pass here applies to every screen and component you mount, so you don't repeat yourself.

The returned instance exposes two methods:

* `createComponent(id, { container, portalObject, configuration })`: mounts a component into a container and returns an `unmount` function.
* `createScreen(id, { container, portalObject, configuration })`: mounts a screen into a container and returns an `unmount` function.

## Initialise

**`Initialise the core`**

```js Initialise the core
import { createSolvimonCore } from '@solvimon/solvimon-web/core';

const solvimon = createSolvimonCore({
    environment: 'TEST',
    locale: 'en-US',
    dateLocale: 'en-US',
    logLevel: 'info',
    branding: {
        colors: {
            primary: '#1d4ed8',
            secondary: '#0f172a',
        },
    },
});

// Mount a screen
const unmount = solvimon.createScreen('checkout', {
    container: '#sdk-root',
    portalObject: checkoutPortalObject,
});

// Mount a component
const unmount = solvimon.createComponent('invoices-list', {
    container: '#invoices-root',
    portalObject: customerPortalObject,
});

// Unmount when done
unmount();
```

## Configuration

| Option                      | Type                                           | Default   | Description                                                                                        |
| --------------------------- | ---------------------------------------------- | --------- | -------------------------------------------------------------------------------------------------- |
| `environment`               | `'TEST'` \| `'LIVE'`                           |           | The Solvimon environment to connect to. Use `'TEST'` with sandbox data and `'LIVE'` in production. |
| `locale`                    | `string`                                       |           | BCP 47 locale code for UI language (e.g. `en-US`, `nl-NL`).                                        |
| `dateLocale`                | `string`                                       |           | BCP 47 locale code for date formatting. Defaults to `locale` if not set.                           |
| `branding.colors.primary`   | `string`                                       |           | Primary brand colour applied to buttons and accents. Accepts any valid CSS colour value.           |
| `branding.colors.secondary` | `string`                                       |           | Secondary brand colour. Accepts any valid CSS colour value.                                        |
| `logLevel`                  | `'debug'` \| `'info'` \| `'warn'` \| `'error'` | `'error'` | Minimum log level for SDK output.                                                                  |
| `onLog`                     | `(entry) => void`                              |           | Custom log handler. Called for every log entry at or above `logLevel`.                             |
| `experimentalFeatures`      | `unknown[]`                                    |           | Opt in to experimental SDK features. Consult Solvimon before using.                                |