Skip to content

davilag/platform-event-consumer

Folders and files

NameName
Last commit message
Last commit date
Jun 7, 2020
Jun 7, 2020
Jun 7, 2020
May 28, 2020
Jun 7, 2020
May 25, 2020
May 25, 2020
Jun 8, 2020
Jul 21, 2020
Jun 7, 2020
May 25, 2020
Jul 20, 2020

Repository files navigation

Platform event consumer

CI NPM version

CLI tool to consume platform events from a Salesforce org.

How to install

Install the CLI tool using yarn or npm:

yarn add global platform-event-consumer

How to run

The script accepts different arguments:

  • -e, --event <event>: Event that we want to consume.
  • -u, --username <username> (Optional): Username of the Salesforce org from which we want to consume events. You will need to authenticate to that org first using SFDX.
  • --env (Optional): if set, the script will get the authentication configuration from the enviromnent variables (see .env file).

Consume events authenticating using SFDX

In order to consume events in this way, you will need to have SFDX installed in your machine and authorize the org you want to consume events from using any of the auth commands.

platform-event-consumer --event Test_Event__e --username [email protected]

Consume events using environment variables

If you don't have SFDX installed in your machine, you can authenticate to any org using OAuth. All the necessary environment variables are listed in the .env file.

Once you have set them up, you can just run:

platform-event-consumer --event Test_Event__e --env