Skip to main content

CoreConfig

wemap-sdk-js


Class: CoreConfig

Core configuration class for initializing the Wemap SDK

This class handles SDK initialization, fetches livemap data from the API, and provides access to the global configuration.

Example

import { core } from '@wemap/core';

// Initialize the SDK
await core.init({
emmid: 'your-emmid',
token: 'your-token',
env: 'production'
});

// Access configuration
const config = CoreConfig.getConfig();

Methods

init()

init(initOptions): Promise\<void>

Initialize the core SDK

Fetches livemap data from the API using the provided emmid and token. This must be called before using other SDK features that depend on configuration.

Parameters

initOptions

InitOptions

Initialization options

Returns

Promise\<void>

Throws

If emmid or token are missing

Example

await core.init({
emmid: 'abc123',
token: 'xyz789',
env: 'production'
});