# Quick and easy SvelteKit setup using universal login page

**URL:** <https://community.auth0.com/t/quick-and-easy-sveltekit-setup-using-universal-login-page/146256>\
**Category:** Get Help\
**Tags:** new-universal-login-experience, login-experience\
**Created:** [September 9, 2024, 6:33pm UTC](https://community.auth0.com/t/quick-and-easy-sveltekit-setup-using-universal-login-page/146256 "2024-09-09T18:33:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![robsyc](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/robsyc/32/60211_2.png) [@robsyc](https://community.auth0.com/u/robsyc)\
**Post date:** [September 9, 2024, 6:33pm UTC](https://community.auth0.com/t/quick-and-easy-sveltekit-setup-using-universal-login-page/146256/1 "2024-09-09T18:33:29Z")

</div>

Having an incredibly hard time setting up universal login on my SvelteKit app.

**Basic structure**

- root route / along with /docs and some other unprotected routes
- /app route this one needs to be protected

**Basic goal**

1. Check if user navigates to any route that starts with /app
2. If it starts with /app validate jwt in cookies
3. If there is no jwt or it’s not valid, send over to universal login page
4. Redirect back to /app, create jwt from access token and store in cookies

However, somehow I’m not able to implement this at all using Auth0. I don’t get why this is so difficult. Someone with knowhow on using Auth0 with Svelte who can help me out? How should I set up hooks & layout? Should I keep a store as well? Documentation online seems outdated.

Kind regards and thank you for reading & considering

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [September 11, 2024, 4:27pm UTC](https://community.auth0.com/t/quick-and-easy-sveltekit-setup-using-universal-login-page/146256/3 "2024-09-11T16:27:19Z")

</div>

Hi @robsyc,

Welcome to the Auth0 Community!

Unfortunately, we do not have a SvelteKit example or SDK at the moment.

In this case, I recommend referring to this related post on a workaround to integrating Auth0 with your SvelteKit app.

> [@Sveltekit Integration](https://community.auth0.com/t/sveltekit-integration/72204/3):
>
> Hi @Svalinn, Welcome to the Auth0 Community! Unfortunately, we don’t have an official sveltekit example or SDK at this time. The closest thing I can suggest would be our [nextjs SDK](https://github.com/auth0/nextjs-auth0), but that is obviously not the same thing. I found an unofficial Auth0/SvelteKit Client, but this is totally outside of Auth0 and is not verified by us in any manner. Regardless, it may be worth checking out/contributing to.

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [September 25, 2024, 4:28pm UTC](https://community.auth0.com/t/quick-and-easy-sveltekit-setup-using-universal-login-page/146256/4 "2024-09-25T16:28:13Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
