Developer docs/Bundled addons
Addon guide example
addons.desc.integration.guide
| Field | Value |
|---|---|
| Addon id | integration-guide |
| Kind | integration |
| Provides | guide |
| Engine | wasm |
| ABI | 0.3.0 |
| Version | 0.1.0 |
| Author | MythicalSystems |
| Source | extensions/examples/addon-guide |
| Permissions (shown at install) | none |
#Capabilities
| Capability | Value |
|---|---|
emits | integration-guide:greeted |
events | invoice.paid, user.registered |
hooks | [{"event":"client.before_register","priority":"normal"},{"event":"login.before","fail_open":true,"priority":"high","timeout_ms":500},{"event":"before:integration-guide:greeted"},{"event":"order.before_place","ignore_cancelled":true,"priority":"highest"},{"event":"after:PUT /api/v1/client/profile","priority":"monitor"}] |
http | example.com |
jobs | [{"every_secs":3600,"op":"cleanup"}] |
kv | true |
mixins | [{"at":"after","target":"GET /api/v1/client/profile"}] |
routes | [{"access":"public","method":"GET","path":"/hello"},{"access":"client","method":"POST","path":"/greet"},{"access":"admin","method":"GET","path":"/stats","permission":"reports.read"}] |
secrets | api_token |
ui | iframe |
#Events and hooks
| What | Value |
|---|---|
Listens to (events) | invoice.paid, user.registered |
| Hooks | client.before_register, login.before, before:integration-guide:greeted, order.before_place, after:PUT /api/v1/client/profile |
| Emits | integration-guide:greeted |
| Mixins | GET /api/v1/client/profile (after) |
| Scheduled jobs | cleanup every 3600 s |
#Settings and secrets
| Setting | Type | Required |
|---|---|---|
greeting | text | no |
api_token | secret | no |
Secrets (stored encrypted, never returned by the API): api_token.
Outbound HTTP allowed to: example.com. $server is the hostname of the server configured for the product, $setting:<key> the host of that setting.
#HTTP routes
Mounted under /api/v1/addons/integration-guide/.
| Method | Path | Access | Permission |
|---|---|---|---|
| GET | /hello | public | - |
| POST | /greet | client | - |
| GET | /stats | admin | reports.read |
#UI
Pages: stats (admin), frame (client). Slots: client.dashboard, admin.invoices.toolbar. See Widgets and slots.
#addon.json