Using clerk with vite and static site
Maybe we don’t really want all of that nextjs
- tags
- clerk
- vite
- vanilla
- javascript
- devdojo
- tails
Contents
I want to see if we can use the devdojo tails app to design the site, then drop it into vite to customize some tailwindcss stuff, and add clerk for user authentication.
Lets go!
Create a new vite project
Lets use typescript without anything else.
|
|
Add tailwindcss
|
|
Update tailwind.config.js
, and for fun we can use one of the Modern
Font Stack in the theme.
|
|
Update style.css
|
|
Copy our design over into index.html
Copy the raw html file over from tails.
Delete the insane style
tag that has the entire tailwindcss in there.
At the bottom, put in
|
|
So vite knows how to build everything.
Get rid of the login buttons, and give that div
and id, such as profile
:
|
|
Add clerk
Install clerk/javascript.
|
|
Create a new app in clerk and copy over the VITE_CLERK_PUBLISHABLE_KEY
into your .env.local
.
Add login to main.ts
:
|
|
Test the build
Build it and run live-server
to see how it works.
|
|
Previously
Next