The Login or signup method wraps the login or signup Email OTP API endpoint.
Login or signup
Method parameters
organization_id* string
email_address* string
login_template_id string
signup_template_id string
locale string
import { useStytchB2BClient } from '@stytch/react/b2b';
export const Login = () => {
const stytch = useStytchB2BClient();
const sendEmailOTP = () => {
stytch.otps.email.loginOrSignup({
email_address: 'sandbox@stytch.com',
organization_id: 'organization-test-07971b06-ac8b-4cdb-9c15-63b17e653931',
});
};
return <button onClick={sendEmailOTP}>Send email OTP</button>;
};
RESPONSE
200
{
"status_code": 200,
"request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141"
}