Skip to main content

Put

Puts event to bus.

import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";

const PutEventRequest =
cloudApi.serverless.eventrouter_event_service.PutEventRequest;

(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.EventServiceClient);

const result = await client.put(
PutEventRequest.fromPartial({
busId: "busId",
body: "body",
})
);
console.log(result);
})();

PutEventRequest

busId : string

ID of the bus to put event.

body : string

Event body.

Empty