How to send SMS messages from Supabase

Sending SMS messages to your users can be a key communication feature in your applications. In this video we will show you how to send an SMS message from Supabase.

In the video we take a look at connecting to the Sinch API for sending sms messages to our users from Supabase.

Using the http extension to Supabase, we work through the http request format, the API keys and endpoint requirements and make a request to the API for sending the sms.

We also look at the Flutterflow side and see how we can call the request from our applications, passing the parameters we need to select the users information from our database tables.

Here is the video. All of the code you see on screen can be downloaded below.

Custom code to send SMS messages from Supabase

This is the main function for constructing the message, connecting to the API and sending the SMS messages. Remember to change the variable names and add the API endpoint for the SMS provider you are using.

This is the function for creating the private schema and the private.keys table within your Subabase project. You can add the API keys to the table directly once the table is created.

To connect to your API from the SQL editor, run this command. Remember to change the UUID of the user you are sending the SMS to.

How to send SMS messages from Flutterflow

For your custom action in Flutterflow use this code and pass in as the parameter the UUID of the user you are sending the SMS message to. This will call the send-sms SQL function we have above.