From ae4d5459fb2c2c4e050c3e3cd3e2c1978d7bf317 Mon Sep 17 00:00:00 2001 From: hmacr Date: Tue, 3 Oct 2023 21:50:50 +0530 Subject: [PATCH 1/2] chore: add example for eventTrigger() doc --- docs/sdk/eventtrigger.mdx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/sdk/eventtrigger.mdx b/docs/sdk/eventtrigger.mdx index fe94f8c961f..5704c2d8da9 100644 --- a/docs/sdk/eventtrigger.mdx +++ b/docs/sdk/eventtrigger.mdx @@ -70,6 +70,19 @@ client.defineJob({ filter: { tier: ["pro"], }, + //(optional) example event object + examples: [ + { + id: "issue.opened", + name: "Issue opened", + payload: { + userId: "1234", + tier: "free", + }, + //optional + icon: "github", + }, + ], }), run: async (payload, io, ctx) => { await io.logger.log("New pro user created", { userId: payload.userId }); From b86c6204f0dccfc97c4ec7a7ef9b0992d598f7d0 Mon Sep 17 00:00:00 2001 From: hmacr Date: Fri, 6 Oct 2023 17:25:53 +0530 Subject: [PATCH 2/2] add documentation to the options parameter --- docs/sdk/eventtrigger.mdx | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/sdk/eventtrigger.mdx b/docs/sdk/eventtrigger.mdx index 5704c2d8da9..5c7b30c95a6 100644 --- a/docs/sdk/eventtrigger.mdx +++ b/docs/sdk/eventtrigger.mdx @@ -45,6 +45,26 @@ You can have multiple Jobs that subscribe to the same event, they will all trigg ``` + + Used to provide example payloads that are accepted by the job. + + This will be available in the dashboard and can be used to trigger test runs. + + + + The example's ID. + + + The name that's displayed in the dashboard. + + + The payload that's accepted by the job. + + + The icon to use for this example in the dashboard. + + +