mit einem Klick
c8y-realtime
Instructions for implementing real-time data updates in Cumulocity UI components using the RealtimeService and its variants. Use when adding real-time capabilities to the UI.
Menü
Instructions for implementing real-time data updates in Cumulocity UI components using the RealtimeService and its variants. Use when adding real-time capabilities to the UI.
REST API documentation and guidance for interacting with the Cumulocity AI service. Use when sending messages to the AI agent.
Multi-scope expert for Cumulocity IoT. Accesses live OpenAPI specs for Core API and Digital Twin Manager (DTM).
Setup the local testing environment for Cumulocity applications to test UI and microservices.
Critical implementation patterns for building Cumulocity microservices that act as MCP (Model Context Protocol) servers. Use when developing MCP servers.
Guidelines for developing microfrontends, plugins, and blueprints in Cumulocity, including manifest configuration and package structure. Use when working with microfrontends.
Guidelines for what needs to be ensured if you want to create a new open source repository in the Cumulocity organization.
| name | c8y-realtime |
| description | Instructions for implementing real-time data updates in Cumulocity UI components using the RealtimeService and its variants. Use when adding real-time capabilities to the UI. |
The RealtimeService is a generic abstract class which implements the interactions with the
real-time API.
There are multiple classes based on this class to match the different real-time channels. These are for example:
AlarmRealtimeServiceAuditRealtimeServiceEventRealtimeServiceMeasurementRealtimeServiceOperationRealtimeServiceManagedObjectRealtimeServiceimport { Component, inject } from '@angular/core';
import { AlarmRealtimeService } from '@c8y/ngx-components';
@Component({
selector: 'my-alarm-realtime-btn',
template: `<button (click)="alarmRealtime.subscribe()">Subscribe</button>`,
providers: [AlarmRealtimeService]
})
export class MyAlarmRealtimeBtnComponent {
alarmRealtime = inject(AlarmRealtimeService);
}
This approach allows users to control the subscription via the UI, while you can still subscribe to updates in your component logic as needed.
For a more advanced example, see the tutorial component below, which demonstrates how to combine multiple realtime services and manage their subscriptions programmatically.