Login to PECB Members Page
npm install @stytch/vanilla-js/b2b --save
import { StytchB2BUIClient } from '@stytch/vanilla-js/b2b';
const stytch = new StytchB2BUIClient('public-token-test-358687de-0bb8-48d1-8e4c-fe463b1f2a47');
// Call Stytch APIs from the browser
stytch.magicLinks.email.loginOrSignup({
email_address: 'wsmetz72@gmail.com',
organization_id: 'organization-test-9de01d7a-60c8-4526-ba34-c1099056bbde',
});
// Render prebuilt UI
stytch.mount({
elementId: '#magic-link',
config: {
authFlowType: 'Discovery',
products: ['emailMagicLinks', 'oauth'],
emailMagicLinksOptions: {
loginRedirectURL: 'https://pecb.info/authenticate',
signupRedirectURL: 'https://pecb.info/authenticate',
},
oauthOptions: {
providers: [{ type: 'google' }, { type: 'microsoft' }],
loginRedirectURL: 'https://pecb.info/authenticate',
signupRedirectURL: 'https://pecb.info/authenticate',
},
sessionOptions: {
sessionDurationMinutes: 60,
},
},
});