ff573632af
## Documentation / Examples This PR adds an example Next.js app that uses [Stytch](https://stytch.com/) for authentication, deployed on Vercel.
11 lines
258 B
TypeScript
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
|
|
}
|