Before Create Token events are executed just before a token is created.
In Projects, select the relevant project or All.
From the Administration module, click Workers.
The Workers screen appears.
Click + New Workers and select New Event Driven Worker
The Create Workers section appears that lists all the types of workers that you can create. The Access section lists workers with a predefined Access system action.
Click Add on the required type of worker.
Configure the worker in the Before Create Token screen.
Enter the name and description of the worker.
Create your worker code in the code editor area.
As you type in the code, the editor provides you an auto-complete function that boosts your productivity.
Click Add Secret.
The Secrets screen appears, where you can add secrets to the worker.
Enter the name and a value for a secret.
Click Add Secret if you want to add more secrets.
To enable troubleshooting even when the worker is successful, toggle Enable Debug.
You can edit the JSON payload in the BeforeCreateTokenRequest pane.
You can use this payload to be injected as the second parameter in your worker function. You can use this to simulate the payload the worker receives in the event.
Click Run Test to test the worker.
The results appear in the Execution Results pane.
You can enable the worker with the Enabled switch.
You can also save the worker and enable it only when required. You can enable the worker by editing the workers from the Configured tab in the Workers screen.
Click Save to save the worker.