The type of Lime CRM client currently running. Use this to conditionally enable features based on the client environment.
Get a service from the platform container.
Services are accessed through the PlatformServiceName enum, which can be extended
by third-party modules using module augmentation.
The name of the service to retrieve
The requested service instance
Check if a service is currently registered on the platform.
Useful for optional dependencies or checking service availability.
The name of the service to check
true if the service is registered, false otherwise
Check if a feature is enabled in the current environment.
Feature switches allow gradual rollout of new functionality and environment-specific behavior. Features can be enabled/disabled at the application, user, or system level.
Name of the feature switch to check
true if the feature is enabled, false otherwise
Register a service on the platform for use throughout the application.
Service names are typically defined in the PlatformServiceName enum through module
augmentation. This ensures type safety and prevents naming conflicts.
The name to register the service under
The service instance to register
const SERVICE_NAME = 'myPlugin.cache';
PlatformServiceName.MyCache = SERVICE_NAME;
declare module '@limetech/lime-web-components' {
interface PlatformServiceNameType {
MyCache: typeof SERVICE_NAME;
}
interface LimeWebComponentPlatform {
get(name: PlatformServiceNameType['MyCache']): CacheService;
}
}
// Register the service
platform.register(PlatformServiceName.MyCache, new CacheService());
Service container for the Lime CRM platform that provides access to all platform services.
The platform acts as a service locator for accessing repositories, the command bus, HTTP client, and other services throughout the application. It is used by web components (injected via Stencil's
@Propdecorator), command handlers, and other parts of the system.The platform type indicates which Lime CRM client is hosting the component:
LimeCRMWebClient: Standard web clientLimeCRMDesktopClient: Desktop application clientLimeCRMWebAdminClient: Administrative web interfaceExample
Example