You don't have a token yet? Contact Sales
API Reference
The <nu-evolution-editor> is a web component that allows you to embed the nuEvolution Editor into your application. It provides a simple API to configure the editor, load profiles, and save them.
Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
token | string | undefined | The access token for the nuEvolution API. |
profile-id | string | undefined | The ID of the profile to load. |
id-type | 'default' | 'external' | 'default' | The type of the ID provided in profile-id. |
capabilities | string | undefined | A space-separated list of enabled capabilities. |
debug | boolean | false | If present, enables debug logging in the console. |
Properties
| Property | Type | Description |
|---|---|---|
token | string | null | The access token. |
profileId | string | null | The ID of the profile to load. |
idType | EditorIdType | The type of the profile ID. |
capabilities | Capability[] | The list of enabled capabilities. |
debug | boolean | Whether debug logging is enabled. |
status | EditorStatus | The current status of the editor (readonly). |
Methods
saveProfile(triggerSavedEvent?: boolean): Promise<ProfileData>
Saves the current profile.
- If a
profileIdis set (either internal or external), the editor will perform an upsert (update existing profile). - If no
profileIdis set, a new profile will be created. triggerSavedEvent: Iftrue, thenuit::profile-savedevent will be dispatched upon successful save.- Returns a
Promise<ProfileData>containing the saved profile's information.
Events
nuit::profile-saved
Dispatched when a profile is successfully saved. This can be triggered by:
- The user clicking the save button in the editor (requires
save-profilecapability). - Calling
saveProfile(true)from the host application.
ts
import { ProfileSavedEvent } from '@nuitdev/evo-embedded'
editor.addEventListener('nuit::profile-saved', (event: ProfileSavedEvent) => {
/* ... */
})ProfileSavedEvent:
ts
interface ProfileData {
profileId: string | null
externalid: string | null
}
declare class ProfileSavedEvent extends CustomEvent<ProfileData>Types & Enums
Capability
| Value | Description |
|---|---|
'profile-catalog-open' | Allows the user to open profiles from the catalog. |
'profile-catalog-save' | Allows the user to save profiles to the catalog. |
'save-profile' | Displays a save button in the editor toolbar. |
EditorIdType
| Value | Description |
|---|---|
'default' | The profile-id is treated as a nuEvolution internal ID. |
'external' | The profile-id is treated as an external ID from your system. |