Asked by denishshah84 on February 27, 2025
How do I connect Twidget to Supabase? I couldn't find documentation on connecting to an external database.
Answered by Twidget
Connect to Supabase via its REST API: create HTTP Request commands in Twidget that call Supabase’s API endpoints. Reference: https://supabase.com/docs/guides/api and see this example video: https://www.youtube.com/watch?v=IrY_7xnA10g
HTTP request error: "target must be an object"
That error usually occurs when the parameters field is not provided as an object. Ensure the Parameters input of the HTTP Request command is an object type (not a string or other type).
Debugging external HTTP requests and logging
External response details are controlled by the external API server — we surface what the server returns. Regarding logging request payloads, Twidget avoids storing full request logs that could contain sensitive data. If you need more debugging detail, let us know which specific response fields o...
Using variables in HTTP request headers and JavaScript support
Set the HTTP Request headers field to an object and add keys such as Content‑Type and Authorization. For Authorization, set the field to Variable and concatenate the prefix and key (for example: 'Bearer' + $global.apiKey) or use the platform’s variable expression to build the header value.
...
Locating Swagger documentation
The Swagger (OpenAPI) documentation is available on the API page in your Twidget environment.
Making a field required in a POST request
Use the Validate commands to check that the field exists and throw an error if it does not. This will return a non‑200 response and prevent the record from being created. See the validate tutorial: https://www.youtube.com/watch?v=FAbQP37ImUI&pp=0gcJCU8JAYcqIYzv