The Capsule modal is the easiest way to get integrated. The modal implements all session management and cookie logic needed for account creation, login, and account management.
The modal also has configuration options to customize for your specific integration.
To apply these changes, simply pass the following configs as properties to the CapsuleModal Component
<CapsuleModalcapsule={capsule}isOpen={isOpen}onClose={() => {setIsOpen(false); }}appName={YOUR_APP_NAME}logo={YOUR_LOGO_URL} // a link to your logo, to be shown in the modaltheme={CUSTOM_THEME}oAuthMethods={["GOOGLE","TWITTER","DISCORD"]}twoFactorAuthEnabled={true}disableEmailLogin={true}/>
Available modal & button configuration props
Property
Type
Required
Default
Description
capsule
Capsule
yes
undefined
set your Capsule instance
isOpen
boolean
yes
undefined
control whether modal is open or closed
onClose
() => void
yes
undefined
function called on modal close (should set isOpen state to false)
backgroundColor?: string; // Used to derive the background colors of your modalforegroundColor?: string; // Used to derive the foreground/highlight colors of your modalborderRadius?: BorderRadius; // The border radius of your modal. Options: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'full'font?: string; // The custom font to use in your modal elementscustomPalette?: CustomPalette; // Custom palette used to customize theming of individual components
<CapsuleModalcapsule={capsule} isOpen={isOpen} onClose={() => {setIsOpen(false)}}appName={YOUR_APP_NAME}logo={YOUR_LOGO_URL} // a link to your logo, to be shown in the modallogoDark={YOUR_LOGO_URL} // an optional link to your logo, to be shown in the modal when in dark themetheme='light'// or 'dark'oAuthMethods={['GOOGLE','TWITTER','DISCORD']}twoFactorAuthEnabled={false}/>
Available modal & button configuration props
Property
Type
Required
Default
Description
capsule
Capsule
yes
undefined
set your Capsule instance
isOpen
boolean
yes
undefined
control whether modal is open or closed
onClose
() => void
yes
undefined
function called on modal close (should set isOpen state to false)
Here's an example of constructorOpts that can be passed in as the third argument to the Capsule() constructor object
// see getting started for importsconstconstructorOpts= {// passkey configs portalBackgroundColor:'white',// deprecated portalPrimaryButtonColor:'red',// deprecated portalTextColor:'black',// deprecated portalPrimaryButtonTextColor:'#FFFFFF',// deprecated portalTheme?: {} // See Custom Theme below;// email configs emailTheme: 'light', emailPrimaryColor:'pink', githubUrl:'https://github.com/vbuterin', linkedinUrl:'https://www.linkedin.com/company/wanderlust-creamery-llc'; xUrl: 'https://twitter.com/eatwanderlust', homepageUrl:'https://wanderlustcreamery.com/', supportUrl:'mailto:help@me.com',// can also be a webpage URL}constcapsule=newCapsule(Environment.BETA,"YOUR_API_KEY", constructorOpts)
Capsule Passkey Prompt
The passkey screen also supports custom images and colors. Custom colors should be passed in as the following opts when instantiating the capsule object.
Images are configured via API key- get in touch to update these!
Custom Theme object
backgroundColor?: string; // Used to derive the background colors of your portalforegroundColor?: string; // Used to derive the foreground/highlight colors of your portalborderRadius?: BorderRadius; // The border radius of your portal elements. Options: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'full'
User-Facing Emails
The following values can be set on emails to brand them - these should be passed in as the following opts when instantiating the capsule object.
/** * Base theme for the emails sent from this Capsule instance. * @default - dark */ emailTheme?: EmailTheme;/** * Hex color to use as the primary color in the emails. * @default - #FE452B */ emailPrimaryColor?: string;/** * Linkedin URL to link to in the emails. Should be a secure URL string starting with https://www.linkedin.com/company/.
*/ linkedinUrl?: string;/** * Github URL to link to in the emails. Should be a secure URL string starting with https://github.com/. */ githubUrl?: string;/** * X (Twitter) URL to link to in the emails. Should be a secure URL string starting with https://twitter.com/. */ xUrl?: string;/** * Support URL to link to in the emails. This can be a secure https URL or a mailto: string. Will default to using the stored application URL is nothing is provided here.
*/ supportUrl?: string;/** * URL for your home landing page. Should be a secure URL string starting with https://. */ homepageUrl?: string;