The <UserProfile /> component is used to render a beautiful, full-featured account management UI that allows users to manage their profile and security settings.
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: /user-profile.
additionalOAuthScopes object
Specify additional scopes per OAuth provider that your users would like to provide if not already approved. For example: {google: ['foo', 'bar'], github: ['qux']}.
customPages CustomPage[]
An array of custom pages to add to the user profile. Only available for the JavaScript SDK. To add custom pages with React-based SDK's, see the dedicated guide.
Usage with frameworks
You can embed the <UserProfile /> component using the Next.js optional catch-all route. This allows you to redirect the user inside your application.
props? UserProfileProps The properties to pass to the <UserProfile /> component
mountUserProfile() usage
main.js
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="user-profile"></div>`constuserProfileDiv=document.getElementById('user-profile')oneauxilia.mountUserProfile(userProfileDiv)
index.html
<!-- Add a <div id="user-profile"> element to your HTML--><divid="user-profile"></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 userProfileDiv =document.getElementById('user-profile')OneAuxilia.mountUserProfile(userProfileDiv) })</script>
unmountUserProfile()
Unmount and run cleanup on an existing <UserProfile /> component instance.
node HTMLDivElement The container <div> element with a rendered component instance.
unmountUserProfile() usage
main.js
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="user-profile"></div>`constuserProfileDiv=document.getElementById('user-profile')oneauxilia.mountUserProfile(userProfileDiv)// ...oneauxilia.unmountUserProfile(userProfileDiv)
index.html
<!-- Add a <div id="user-profile"> element to your HTML--><divid="user-profile"></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 userProfileDiv =document.getElementById('user-profile')OneAuxilia.mountUserProfile(userProfileDiv)// ...OneAuxilia.unmountUserProfile(userProfileDiv) })</script>
openUserProfile()
Opens the <UserProfile /> component as an overlay at the root of your HTML body element.
props? UserProfileProps The properties to pass to the <UserProfile /> component
openUserProfile() usage
main.js
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="user-profile"></div>`constuserProfileDiv=document.getElementById('user-profile')oneauxilia.openUserProfile(userProfileDiv)
index.html
<!-- Add a <div id="user-profile"> element to your HTML--><divid="user-profile"></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 userProfileDiv =document.getElementById('user-profile')OneAuxilia.openUserProfile(userProfileDiv) })</script>
closeUserProfile()
Closes the user profile overlay.
functioncloseUserProfile():void
closeUserProfile() usage
main.js
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="user-profile"></div>`constuserProfileDiv=document.getElementById('user-profile')oneauxilia.closeUserProfile(userProfileDiv)
index.html
<!-- Add a <div id="user-profile"> element to your HTML--><divid="user-profile"></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 userProfileDiv =document.getElementById('user-profile')OneAuxilia.closeUserProfile(userProfileDiv) })</script>
Customization
To learn about how to customize OneAuxilia components, see the customization documentation.
In addition, you also can add custom pages and links to the <UserProfile /> navigation sidebar. For more information, refer to the Custom Pages documentation.