> For the complete documentation index, see [llms.txt](https://edgar-p-yan.gitbook.io/authembed-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://edgar-p-yan.gitbook.io/authembed-docs/configuration/triggers.md).

# Triggers

You can configure triggers in `config.json` file. Here is an example of a trigger, which registers a script to run when a new user completes registration. You can also specify modules for your script:

{% code title="config.json" %}

```javascript
{
  "triggers": [
    {
      "on": "user-registered",
      "action": "initUserInMessembed",
      "modules": {
        "messembed-sdk": "^0.4.2",
        "axios": "latest"
      }
    }
  ]
}
```

{% endcode %}

&#x20;Here `triggers` is an array of triggers:

| Trigger configuration | Description                                                                                                                                                                                    |
| --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `on`                  | The event on which trigger should run. At the moment only `user-registered` event is supported.                                                                                                |
| `action`              | The name of the script to run. File with the script should be stored in the `actions` folder in the root directory. Only JavaScript files can be used as actions, e.g `initUserInMessembed.js` |
| `modules`             | NPM modules that your script requires. Authembed will manage to provide your script with all required modules.                                                                                 |
