Installation

Add clerk.js to your page

Replace data-clerk-frontend-api with the Frontend API host found in your dashboard.

<script>
const frontendApi = "clerk.abc123.lcl.dev";
const clerkOptions = {
// Set options here
}
const script = document.createElement('script');
script.setAttribute('data-clerk-frontend-api', frontendApi);
script.async = true;
script.src = `https://${frontendApi}/npm/@clerk/[email protected]/dist/clerk.browser.js`
script.addEventListener('load', function(){
window.Clerk.load(clerkOptions);
});
document.body.appendChild(script);
</script>

Options

Name

Description

navigate?

(to: string) => Promise<any> | void

A function which takes the destination path as an argument and performs a "push" navigation.