0.0.1-alpha.24 • Published 1 day ago

@novu/echo v0.0.1-alpha.24

Weekly downloads
-
License
ISC
Repository
-
Last release
1 day ago

Quickstart

const client = new Echo();
client.workflow(
  'comment-on-post',
  { type: 'object', properties: { post: { type: 'string' } } },
  async ({ step }) => {
    const userResponse = step.custom(
      'fetch-user',
      { type: 'object', properties: { name: { type: 'string' } } },
      async () => ({ email: 'joe@bloggs.com' }),
    );

    step.email('send-email', async (payload) => {
      return {
        subject: 'You received a post',
        body: `<html><body>${payload.post}</body></html>`,
        to: userResponse.email,
      };
    });

    step.email('send-follow-up', async (payload) => {
      return {
        subject: 'You received a follow-up',
        body: `<html><body>${payload.post}</body></html>`,
        to: userResponse.email,
      };
    });
  },
);

// Get the workflows
const workflows = client.getRegisteredWorkflows();

// Invoke a step
const result = client
  .invokeStep('comment-on-post', 'fetch-user', { post: 'Hello' })
  .then(console.log);
0.0.1-alpha.23

13 days ago

0.0.1-alpha.22

20 days ago

0.0.1-alpha.18

20 days ago

0.0.1-alpha.17

20 days ago

0.0.1-alpha.21

20 days ago

0.0.1-alpha.19

20 days ago

0.0.1-alpha.16

1 month ago

0.0.1-alpha.15

1 month ago

0.0.1-alpha.14

2 months ago

0.0.1-alpha.12

2 months ago

0.0.1-alpha.11

2 months ago

0.0.1-alpha.13

2 months ago

0.0.1-alpha.10

2 months ago

0.0.1-alpha.8

2 months ago

0.0.1-alpha.9

2 months ago

0.0.1-alpha.7

2 months ago

0.0.1-alpha.6

2 months ago

0.0.1-alpha.4

2 months ago

0.0.1-alpha.5

2 months ago

0.0.1-alpha.3

2 months ago

0.0.1-alpha.2

2 months ago

0.0.1-alpha.1

2 months ago

0.0.1-alpha.0

2 months ago