In Twidget, you can build custom reusable functions. These functions can be utilized across various sections including endpoints, events, and other functions. Instead of creating the same commands repeatedly, you can create a function once and reuse it wherever necessary, making your workflow more efficient and maintainable.
-
Functions in Twidget are structured similarly to endpoints. However, instead of using typical endpoint inputs such as query, headers, and body, functions use data type inputs.
Functions require specific data type inputs to operate. These inputs are defined in the inputs section of the function.
Each function also has an optional output. To simplify the use of functions, you can define an output schema. The output schema acts as an internal documentation detailing what the output of the function will look like. This makes it easier to understand and utilize the function correctly.
All custom functions you've created can be viewed in the Your Functions section of the Add Commands sidebar. This centralized view allows you to easily manage and access your reusable functions.
When you need to use a custom function that has inputs, you will be prompted to enter the required inputs in the Commands sidebar. This ensures that the function has all the necessary data to execute correctly.
Inputs
Overview. In Twidget, inputs are essential elements that allow you to configure endpoints and functions. Events do not use inputs. Endpoint Inputs. Endpoint inputs are used to retrieve data from requests. The available types of endpoint inputs are: 1. Path: Variables that are part of the URL path. 2...
Publishing Changes
With Twidget's publishing feature, you can seamlessly push your changes live, ensuring that your updates take effect on the specified endpoint, function, or event. This feature also allows for version control, enabling you to revert and manage different versions of your changes effectively. Steps to...
Output
Each function also has an optional output where you can return an output variable. To simplify the use of functions, you can define an output schema. The output schema acts as an internal documentation detailing what the output of the function will look like. This makes it easier to understand and u...
Changes
In Twidget, every modification you make in our no-code builder is meticulously documented and stored as a change. Whether you are creating an input or editing a command, each action is captured in the platform. Important: Please note changes will not go live until they are published. Viewing Changes...
Testing
In Twidget, you can easily test your endpoints and functions directly within our code builder. This guide will walk you through the steps to efficiently test your functions to ensure they meet your requirements. Running Tests. To start testing, follow these steps: 1. Open Code Builder: - Navigate to...