directus-extension-api-trigger-interface
v1.0.0
Published
Trigger API calls from the UI
Downloads
947
Maintainers
Readme
Introduction
A Directus interface extension for triggering API calls from the UI.
- Support common HTTP methods. GET, POST, PUT, PATCH, DELETE.
- API calls are authenticated automatically.
- Dynamic URL. Use micromustache to generate dynamic URL based on the current values of the item.
- Disable trigger based on the current values of the item.
Installation
npm i directus-extension-api-trigger-interface
Get Started
- Go to Settings, create a new field with type alias.
- In the Interface panel, choose API Trigger interface. There are 2 options:
- Layout: Display the button list vertically or horizontally.
- Triggers: A list of trigger.
- Label: label of the button
- Size: size of the button
- Type: style of the button
- Icon: icon of the button
- URL: API endpoint
- Method: Method of the API call
- Reload: If enabled, reload the browser if call succeeded
- Disabled Conditions: disable the button if the conditions are met.
Limitation
- Only works for same domain APIs.
TODO
- Allow to disable authentication.
- Call external APIs.
- Reduce budnle size.