This is the function ```import "jsr:@supabase/functions-js/edge-runtime.d.ts" import { Webhook } from 'https://esm.sh/standardwebhooks@1.0.0' import { readAll } from 'https://deno.land/std/io/read_all.ts' import * as base64 from 'https://denopkg.com/chiefbiiko/base64/mod.ts' import twilio from "npm:twilio" const accountSid: string | undefined = Deno.env.get('TWILIO_ACCOUNT_SID') const authToken: string | undefined = Deno.env.get('TWILIO_AUTH_TOKEN') const serviceSid: string | undefined = Deno.env.get('TWILIO_SERVICE_SID') const apphash: string | undefined = Deno.env.get('APP_HASH') const client = twilio(accountSid, authToken); Deno.serve(async (req) => { const payload = await req.text() console.log(payload); const hookSecret = Deno.env.get('SEND_SMS_HOOK_SECRET') if (!hookSecret) { return new Response( JSON.stringify({ error: { http_code: 500, message: 'SEND_SMS_HOOK_SECRET environment variable is not set', } }), { status: 500, headers: { 'Content-Type': 'application/json', }, } ) } const base64_secret = hookSecret.replace('v1,whsec_', '') const headers = Object.fromEntries(req.headers) const wh = new Webhook(base64_secret) try { const { user, sms } = wh.verify(payload, headers) console.log(`verified?`); const messageBody = `Your Social Jawn OTP is: ` const response = await client.verify.v2.services(serviceSid).verifications.create({ channel: 'sms', to: `+${user.phone}`, // customMessage: messageBody, customCode: sms.code, appHash: apphash, }) console.log(`response: ${response.status}, ${response.code}, ${response.message}`); if (response.status !== 'queued') { return new Response( JSON.stringify({ error: { http_code: response.code, message: `Failed to send SMS: ${response.message}. More info: ${response.more_info}`, }, }), { status: 400, headers: { 'Content-Type': 'application/json', }, } ) } return new Response( JSON.stringify({}), { status: 200, headers: { 'Content-Type': 'application/json', }, } ) } catch (error) { console.log(`error: ${error}`); return new Response( JSON.stringify({ error: { http_code: 500, message: `Failed to send sms: ${JSON.stringify(error)}`, } }), { status: 500, headers: { 'Content-Type': 'application/json', }, } ) } })```