Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Sending real-time notifications from the API to the Admin app over websockets, and reacting to them on the client. Use this skill when the developer wants to push a message to the user who triggered some server-side work (e.g. per-entry progress from a background task/bulk action) and show a toast, update a cache, or refresh UI in response. Requires Webiny 6.5.0 or newer.
.claude/skills/webiny-webiny-websocket-notifications/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | -36% | 0% |
| case-02 | ✗→✓ | ▲ Improved | -20% | 0% |
| case-03 | ✗→✓ | ▲ Improved | -16% | 0% |
| case-05 | ✗→✓ | ▲ Improved | -28% | 0% |
| case-06 | ✗→✓ | ▲ Improved | -21% | 0% |
On the API, inject WebsocketsSendToIdentityUseCase (webiny/api) + IdentityContext (webiny/api/security) and call sendToIdentity.execute({ id }, { action, data }). On the Admin, implement a WebsocketEventHandler (webiny/admin/websockets) that filters on action and reacts (e.g. toast via Notifications from webiny/admin), registered with createFeature + RegisterFeature.
typescriptimport { WebsocketsSendToIdentityUseCase } from "webiny/api"; import { IdentityContext } from "webiny/api/security"; class MyTaskOrHook { constructor( private identityContext: IdentityContext.Interface, private sendToIdentity: WebsocketsSendToIdentityUseCase.Interface ) {} async notify(entry) { // Best-effort: a websocket failure must never fail the real work. try { const identity = this.identityContext.getIdentity(); if (identity) { await this.sendToIdentity.execute( { id: identity.id }, { action: "cms.product.discountApplied", data: { id: entry.entryId, price: entry.values.price } } ); } } catch (ex) { // log & swallow } } } // dependencies: [IdentityContext, WebsocketsSendToIdentityUseCase]
IdentityContext. In abackground task/bulk action, the triggering identity is available.
action string; put the payload in data.{ action?: string; data?: T; error?: {...} }.typescriptimport { WebsocketEventHandler } from "webiny/admin/websockets"; import { Notifications } from "webiny/admin"; const ACTION = "cms.product.discountApplied"; class MyHandlerImpl implements WebsocketEventHandler.Interface { constructor(private notifications: Notifications.Interface) {} async handle(event: WebsocketEventHandler.Event): Promise<void> { const payload = event.payload as { action?: string; data?: { id: string; price: number } }; if (payload.action !== ACTION || !payload.data) { return; // every handler sees every message — filter by action } this.notifications.success({ title: "Discount applied", description: `New price ${payload.data.price}.` }); } } export const MyHandler = WebsocketEventHandler.createImplementation({ implementation: MyHandlerImpl, dependencies: [Notifications] });
Read the message off event.payload — event.payload.action and event.payload.data (the exact { action, data } object the API sent).
Register the handler in a feature and render it from your Admin.Extension:
tsximport { createFeature, RegisterFeature } from "webiny/admin"; import { MyHandler } from "./MyHandler.js"; const MyFeature = createFeature({ name: "MyExtension/Notifications", register(container) { container.register(MyHandler); } }); export default () => <RegisterFeature feature={MyFeature} />;
The websockets runner resolves every registered WebsocketEventHandler and calls handle for each incoming message — hence the action filter in each handler.
webiny-cms-bulk-actions — the typical emitter: a bulk action's processData sends amessage per processed entry so the Admin can toast progress live.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 22,390 | 13,290 | -41% | 1 | 1 | 0% | 3,921 | 2,507 | -36% | 0 | 0 | — |
case-02 | fail→pass | 18,497 | 7,873 | -57% | 1 | 1 | 0% | 3,113 | 2,487 | -20% | 0 | 0 | — |
case-03 | fail→pass | 20,316 | 10,752 | -47% | 1 | 1 | 0% | 3,673 | 3,088 | -16% | 0 | 0 | — |
case-04 | pass→pass | 13,914 | 5,767 | -59% | 1 | 1 | 0% | 2,355 | 1,849 | -21% | 0 | 0 | — |
case-05 | fail→pass | 14,121 | 4,556 | -68% | 1 | 1 | 0% | 2,302 | 1,654 | -28% | 0 | 0 | — |
case-06 | fail→pass | 18,202 | 7,293 | -60% | 1 | 1 | 0% | 3,029 | 2,389 | -21% | 0 | 0 | — |
case-07 | fail→pass | 14,854 | 8,745 | -41% | 1 | 1 | 0% | 2,103 | 2,299 | +9% | 0 | 0 | — |
case-08 | fail→pass | 17,031 | 6,334 | -63% | 1 | 1 | 0% | 2,861 | 2,020 | -29% | 0 | 0 | — |
case-09 | fail→pass | 17,512 | 4,295 | -75% | 1 | 1 | 0% | 2,882 | 1,680 | -42% | 0 | 0 | — |
case-10 | pass→pass | 7,059 | 2,355 | -67% | 1 | 1 | 0% | 1,200 | 1,257 | +5% | 0 | 0 | — |
case-11 | fail→pass | 14,014 | 4,397 | -69% | 1 | 1 | 0% | 1,949 | 1,695 | -13% | 0 | 0 | — |
case-12 | fail→pass | 10,197 | 2,368 | -77% | 1 | 1 | 0% | 1,513 | 1,322 | -13% | 0 | 0 | — |
case-13 | fail→fail | 19,964 | 10,426 | -48% | 1 | 1 | 0% | 3,367 | 2,887 | -14% | 0 | 0 | — |
case-14 | fail→pass | 10,614 | 3,560 | -66% | 1 | 1 | 0% | 1,746 | 1,534 | -12% | 0 | 0 | — |
case-15 | fail→pass | 9,958 | 4,312 | -57% | 1 | 1 | 0% | 1,583 | 1,666 | +5% | 0 | 0 | — |
case-16 | pass→pass | 12,231 | 3,650 | -70% | 1 | 1 | 0% | 1,895 | 1,585 | -16% | 0 | 0 | — |
case-17 | pass→pass | 13,808 | 5,187 | -62% | 1 | 1 | 0% | 2,348 | 1,596 | -32% | 0 | 0 | — |
case-18 | fail→pass | 15,560 | 8,578 | -45% | 1 | 1 | 0% | 2,670 | 2,240 | -16% | 0 | 0 | — |
case-19 | pass→pass | 13,749 | 7,822 | -43% | 1 | 1 | 0% | 2,240 | 2,205 | -2% | 0 | 0 | — |
case-20 | pass→pass | 15,227 | 14,205 | -7% | 1 | 1 | 0% | 2,767 | 3,453 | +25% | 0 | 0 | — |
case-21 | pass→pass | 14,145 | 12,211 | -14% | 1 | 1 | 0% | 2,615 | 3,277 | +25% | 0 | 0 | — |
case-22 | pass→pass | 16,230 | 11,737 | -28% | 1 | 1 | 0% | 2,869 | 2,987 | +4% | 0 | 0 | — |
case-23 | pass→pass | 15,435 | 14,712 | -5% | 1 | 1 | 0% | 2,934 | 3,652 | +24% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +57 percentage points is the difference between those two pass rates over the 23 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.