Unclear how to call phoneNumber signup from frontend

I'm using phone-number for sign-up, my authClient looks like ..
export const authClient = createAuthClient({
baseURL: "http://localhost:8081",
plugins: [
expoClient({
scheme: "app",
storagePrefix: "app",
storage: SecureStore,
}),
phoneNumberClient(),
],
});
export const authClient = createAuthClient({
baseURL: "http://localhost:8081",
plugins: [
expoClient({
scheme: "app",
storagePrefix: "app",
storage: SecureStore,
}),
phoneNumberClient(),
],
});
my auth backend is properly configured, but in my register page I'm unsure what to call, should it be -
await authClient.signUp.email({
phoneNumber: "+1234567890",
});
await authClient.signUp.email({
phoneNumber: "+1234567890",
});
There is no authClient.signUp.phoneNumber() function
Solution:
You have to send the otp for the verification and make sure to pass signUpOnVerification to set up a temporary email since right better auth requires an email fields and also the same for name. And you can sign in back with signin.phoneNumber .
Jump to solution
7 Replies
kevcube
kevcubeOP4d ago
Yes, I'm following those docs but still not sure how to call the actual sign up method. should I call it with email? or is there some arbitrary call? there is no phoneNumber call
Solution
KiNFiSH
KiNFiSH4d ago
You have to send the otp for the verification and make sure to pass signUpOnVerification to set up a temporary email since right better auth requires an email fields and also the same for name. And you can sign in back with signin.phoneNumber .
kevcube
kevcubeOP4d ago
ok - yes i have the backend configured properly for the temp name/email. So I just send the OTP and the user account is created? I'll try that
No description
KiNFiSH
KiNFiSH4d ago
Yeah and make sure to verify it
kevcube
kevcubeOP4d ago
Works. Thanks!

Did you find this page helpful?