The component renders a UI for signing up users. The functionality of the component is controlled by the instance settings you specify in your OneAuxilia Dashboard, such as sign-in and sign-up options and social connections. You can further customize your component by passing additional properties at the time of rendering.
Note
The and components cannot render when a user is already signed in, unless the application allows multiple sessions. If a user is already signed in and the application only allows a single session, OneAuxilia will redirect the user to the Home URL instead.
Properties
All props are optional.
appearance Appearance | undefined
Optional object to style your components. Will only affect OneAuxilia components and not Account Portal pages.
routing 'hash' | 'path' | 'virtual'
The routing strategy for your pages. Defaults to 'path' in Next.js and Remix applications. Defaults to hash for all other SDK's.
path string
The path where the component is mounted on when routing is set to path. It is ignored in hash- and virtual-based routing. For example: /sign-up.
signInUrl string
Full URL or path to the sign in page. Use this property to provide the target of the 'Sign In' link that's rendered. It's recommended to use the environment variable instead.
forceRedirectUrl? string
If provided, this URL will always be redirected to after the user signs up. Takes priority over deprecated props such as afterSignUpUrl and redirectUrl. It's recommended to use the environment variable instead.
fallbackRedirectUrl? string
The fallback URL to redirect to after the user signs up, if there's no redirect_url in the path already. Defaults to /. Takes priority over deprecated props such as afterSignUpUrl and redirectUrl. It's recommended to use the environment variable instead.
signInForceRedirectUrl? string
If provided, this URL will always be redirected to after the user signs in. Takes priority over deprecated props such as afterSignUpUrl and redirectUrl. It's recommended to use the environment variable instead.
signInFallbackRedirectUrl? string
The fallback URL to redirect to after the user signs in, if there's no redirect_url in the path already. Defaults to /. Takes priority over deprecated props such as afterSignUpUrl and redirectUrl. It's recommended to use the environment variable instead.
initialValues SignUpInitialValues
The values used to prefill the sign-up fields with.
Usage with frameworks
The following example includes basic implementation of the component. You can use this as a starting point for your own implementation.
The following example demonstrates how you can use the component on a public page.
If you would like to create a dedicated /sign-up page in your Next.js application, check out the dedicated guide.
import { OneAuxilia } from'@oneauxilia/oneauxilia-js'// Initialize OneAuxilia with your OneAuxilia publishable keyconstoneauxilia=newOneAuxilia('YOUR_PUBLISHABLE_KEY')awaitoneauxilia.load()document.getElementById('app').innerHTML =` <div id="sign-up"></div>`constsignUpDiv=document.getElementById('sign-up')oneauxilia.mountSignUp(signUpDiv)
index.js
<!-- Add a <div id="sign-up"> element to your HTML--><divid="sign-up"></div><!-- Initialize OneAuxilia with yourOneAuxilia Publishable key and Frontend APIURL--><scriptasynccrossorigin="anonymous"data-oneauxilia-publishable-key="YOUR_PUBLISHABLE_KEY"src="https://YOUR_FRONTEND_API_URL/npm/@oneauxilia/oneauxilia-js@latest/dist/oneauxilia.browser.js"type="text/javascript"></script><script> window.addEventListener('load', async function () {awaitOneAuxilia.load() const signUpDiv =document.getElementById('sign-up')OneAuxilia.mountSignUp(signUpDiv) })</script>
unmountSignUp()
Unmount and run cleanup on an existing <SignUp /> component instance.
functionunmountSignUp(node:HTMLDivElement):void
unmountSignUp() params
node HTMLDivElement
The container <div> element with a rendered <SignUp /> component instance
unmountSignUp() usage
index.ts
import { OneAuxilia } from'@oneauxilia/oneauxilia-js'// Initialize OneAuxilia with your OneAuxilia publishable keyconstoneauxilia=newOneAuxilia('YOUR_PUBLISHABLE_KEY')awaitoneauxilia.load()document.getElementById('app').innerHTML =` <div id="sign-up"></div>`constsignUpDiv=document.getElementById('sign-up')oneauxilia.mountSignUp(signUpDiv)// ...oneauxilia.unmountSignUp(signUpDiv)
index.js
<!-- Add a <div id="sign-up"> element to your HTML--><divid="sign-up"></div><!-- Initialize OneAuxilia with yourOneAuxilia Publishable key and Frontend APIURL--><scriptasynccrossorigin="anonymous"data-oneauxilia-publishable-key="YOUR_PUBLISHABLE_KEY"src="https://YOUR_FRONTEND_API_URL/npm/@oneauxilia/oneauxilia-js@latest/dist/oneauxilia.browser.js"type="text/javascript"></script><script> window.addEventListener('load', async function () {awaitOneAuxilia.load() const signUpDiv =document.getElementById('sign-up')OneAuxilia.mountSignUp(signUpDiv)// ...OneAuxilia.unmountSignUp(signUpDiv) })</script>
openSignUp()
Opens the component as an overlay at the root of your HTML body element.
functionopenSignUp(props?:SignUpProps):void
openSignUp() params
props? SignUpProps
The properties to pass to the <SignUp /> component
mountSignUp() usage
index.ts
import { OneAuxilia } from'@oneauxilia/oneauxilia-js'// Initialize OneAuxilia with your OneAuxilia publishable keyconstoneauxilia=newOneAuxilia('YOUR_PUBLISHABLE_KEY')awaitoneauxilia.load()document.getElementById('app').innerHTML =` <div id="sign-up"></div>`constsignUpDiv=document.getElementById('sign-up')oneauxilia.mountSignUp(signUpDiv)
index.js
<!-- Add a <div id="sign-up"> element to your HTML--><divid="sign-up"></div><!-- Initialize OneAuxilia with yourOneAuxilia Publishable key and Frontend APIURL--><scriptasynccrossorigin="anonymous"data-oneauxilia-publishable-key="YOUR_PUBLISHABLE_KEY"src="https://YOUR_FRONTEND_API_URL/npm/@oneauxilia/oneauxilia-js@latest/dist/oneauxilia.browser.js"type="text/javascript"></script><script> window.addEventListener('load', async function () {awaitOneAuxilia.load() const signUpDiv =document.getElementById('sign-up')OneAuxilia.mountSignUp(signUpDiv) })</script>
unmountSignUp()
Unmount and run cleanup on an existing <SignUp /> component instance.
functionunmountSignUp(node:HTMLDivElement):void
unmountSignUp() params
node HTMLDivElement
The container element with a rendered <SignUp /> component instance
unmountSignUp() usage
index.ts
import { OneAuxilia } from'@oneauxilia/oneauxilia-js'// Initialize OneAuxilia with your OneAuxilia publishable keyconstoneauxilia=newOneAuxilia('YOUR_PUBLISHABLE_KEY')awaitoneauxilia.load()document.getElementById('app').innerHTML =` <div id="sign-up"></div>`constsignUpDiv=document.getElementById('sign-up')oneauxilia.mountSignUp(signUpDiv)// ...oneauxilia.unmountSignUp(signUpDiv)
index.js
<!-- Add a <div id="sign-up"> element to your HTML--><divid="sign-up"></div><!-- Initialize OneAuxilia with yourOneAuxilia Publishable key and Frontend APIURL--><scriptasynccrossorigin="anonymous"data-oneauxilia-publishable-key="YOUR_PUBLISHABLE_KEY"src="https://YOUR_FRONTEND_API_URL/npm/@oneauxilia/oneauxilia-js@latest/dist/oneauxilia.browser.js"type="text/javascript"></script><script> window.addEventListener('load', async function () {awaitOneAuxilia.load() const signUpDiv =document.getElementById('sign-up')OneAuxilia.mountSignUp(signUpDiv)// ...OneAuxilia.unmountSignUp(signUpDiv) })</script>
openSignUp()
Opens the <SignUp /> component as an overlay at the root of your HTML body element.
functionopenSignUp(props?:SignUpProps):void
openSignUp() params
props? SignUpProps
The properties to pass to the <SignUp /> component
openSignUp() usage
index.ts
import { OneAuxilia } from'@oneauxilia/oneauxilia-js'// Initialize OneAuxilia with your OneAuxilia publishable keyconstoneauxilia=newOneAuxilia('YOUR_PUBLISHABLE_KEY')awaitoneauxilia.load()oneauxilia.openSignUp()
index.html
<!-- Initialize OneAuxilia with yourOneAuxilia Publishable key and Frontend APIURL--><scriptasynccrossorigin="anonymous"data-oneauxilia-publishable-key="YOUR_PUBLISHABLE_KEY"src="https://YOUR_FRONTEND_API_URL/npm/@oneauxilia/oneauxilia-js@latest/dist/oneauxilia.browser.js"type="text/javascript"></script><script> window.addEventListener('load', async function () {awaitOneAuxilia.load()OneAuxilia.openSignUp() })</script>
closeSignUp()
Closes the sign up overlay.
functioncloseSignUp():void
closeSignUp() usage
index.ts
import { OneAuxilia } from'@oneauxilia/oneauxilia-js'// Initialize OneAuxilia with your OneAuxilia publishable keyconstoneauxilia=newOneAuxilia('YOUR_PUBLISHABLE_KEY')awaitoneauxilia.load()oneauxilia.openSignUp()// ...oneauxilia.closeSignUp()
index.html
<!-- Initialize OneAuxilia with yourOneAuxilia Publishable key and Frontend APIURL--><scriptasynccrossorigin="anonymous"data-oneauxilia-publishable-key="YOUR_PUBLISHABLE_KEY"src="https://YOUR_FRONTEND_API_URL/npm/@oneauxilia/oneauxilia-js@latest/dist/oneauxilia.browser.js"type="text/javascript"></script><script> window.addEventListener('load', async function () {awaitOneAuxilia.load()OneAuxilia.openSignUp()// ...OneAuxilia.closeSignUp() })</script>
Customization
To learn about how to customize OneAuxilia components, see the customization documentation.