rsnext/examples/auth-with-stytch/lib/otpUtils.ts
Chris ff573632af
Add authentication example using Stytch (#32194)
## Documentation / Examples

This PR adds an example Next.js app that uses [Stytch](https://stytch.com/) for authentication, deployed on Vercel.
2021-12-22 19:30:44 +00:00

11 lines
258 B
TypeScript

export async function sendOTP(phoneNumber: string) {
const resp = await fetch('/api/send_otp', {
method: 'POST',
body: JSON.stringify({
intlCode: '+1',
phoneNumber,
}),
})
const data = await resp.json()
return data.methodId
}