SMS-Hook with Twilio Verify
Are we able to use SMS-hook with twilio verify? I tried and the sms is sent but the edge function always returns an error to the client application in flutter.
11 Replies
I now get an invalid payload sent to hook message
You will need to show your edge function code. Sms hook simply calls your function and you need to send a 200 response from function. sms hook doesn't care what you do inside the function. For example: You could even be sending email from this hook.
You have multiple log statements. Have you checked in logs where the issue arises?
Yes from what I can see is the response status is on pending which I have no clue on how to handle that. The example on supabase shows for the normal twilio and not verify
But thats something you will need to check on twilio docs. For example, this is my function where I send discord webhook from when sms hook triggers the function. hook only needs you to respond with 200 status code
Okay I see so that might be the issue let me adjust that. Thanks
in your code you have this if check:
if (response.status !== 'queued') { and you mention that response.status is pending, so this if check is trueThat worked
If it was something specific to twilio can you please add it here so that someone might benefit in the future.
So just switching the status check to check if pending or if you really don’t need the status check both worked. I am doing some more testing just to make sure everything works