-
Notifications
You must be signed in to change notification settings - Fork 190
/
clerk.html
35 lines (28 loc) · 1 KB
/
clerk.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<div id="app" style="display: flex; align-items: center; justify-content: center; height: 80vh; font-family: system-ui, Inter, sans-serif;"></div>
<!-- Initialize Clerk with your
Clerk Publishable key and Frontend API URL -->
<script
async
crossorigin="anonymous"
data-clerk-publishable-key="pk_test_bW9yZS1uZXd0LTc3LmNsZXJrLmFjY291bnRzLmRldiQ"
src="https://more-newt-77.clerk.accounts.dev/npm/@clerk/clerk-js@latest/dist/clerk.browser.js"
type="text/javascript"
></script>
<script>
window.addEventListener('load', async function () {
await Clerk.load()
if (Clerk.user) {
document.getElementById('app').innerHTML = `
<div id="user-button"></div>
`
const userButtonDiv = document.getElementById('user-button')
Clerk.mountUserButton(userButtonDiv)
} else {
document.getElementById('app').innerHTML = `
<div id="sign-in"></div>
`
const signInDiv = document.getElementById('sign-in')
Clerk.mountSignIn(signInDiv)
}
})
</script>