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