Welcome to the Kinde community.

P
K
A
A
A

first-time user seeking guidance on creating a sveltekit app with Kinde api

First time user. Attempting to create my first app in Kinde dashboard. What type of app for a sveltekit to interact with Kinde api? Is it back-end web, M2M or Front-end and mobile app? Which one should I use to create an app and use it in my sveltekit for authentication using email+code?

D
F
12 comments

Hi, Welcome to Kinde πŸ‘‹

For Svelte you're wanting to use the backend app.

Hi, Thanks. Sveltekit not svelte (which is SPA)

Apologies, I meant sveltekit

Thank you very much. Another question : after I follow your example https://docs.kinde.com/developer-tools/sdks/backend/sveltekit-sdk/

After I add register/+page.svelte to register, How do I display the form from kinde? The one in the design tab in the app dashboard from kinde?

Have you seen our starter kit with a simple working example, this may help. https://github.com/kinde-starter-kits/sveltekit-starter-kit

I downloaded that example but when I click on signin or register and I get 404 error

How do you display the forms from the design tab inside app dashboard in Kinde.com admin section?

There is a tab in the admin section for the app named "design", how do you display those form the user when they click register under /api/auth/login?

Did you set up the environment variables on the starter kit?

Have you found our documentation for the sveltekit SDK? https://docs.kinde.com/developer-tools/sdks/backend/sveltekit-sdk/

Thank you, Daniel, for engaging with my thread. I appreciate it.

I keep getting this message and it's self-explanatory but I have the correct url entered in my env file like this : http://localhost:5173/api/auth/callback I created the folder/file inside the api/[...KindeAuth]/callback/+page.svelte
I also entered that in the app dashboard admin section in kinde.com Yet, I keep getting the invalide kinde_redirect_url : invalid url??

Here is my whole env file after altering the secret and id entries : KINDE_AUDIENCE=your_kinde_api KINDE_CLIENT_ID=fab961ce34da KINDE_CLIENT_SECRET=CWzom KINDE_ISSUER_URL=https://sveltek.kinde.com/ KINDE_POST_LOGIN_REDIRECT_URL=http://localhost:5173/api/auth/callback KINDE_POST_LOGOUT_REDIRECT_URL=http://localhost:5173/ KINDE_REDIRECT_URL=http://localhost:5173/api/auth/callback KINDE_SCOPE=profile email offline openid KINDE_USER_EMAIL_TEST= // An user has existed in your organization KINDE_USER_PASSWORD_TEST= KINDE_AUTH_WITH_PKCE= KINDE_DEBUG=false

It was my env file. Now everything is working. Thank you all for the help. Carry on.

Explanation for the .env issue:

The issue was because of the .env file.

I'm using vs code. When I created the .env file, I hit enter to start a new line. That empty space is the issue. When you create your .env file in sveltekit, just copy and paste. No empty spaces, tab, or enter. Just copy from your dashboard, create .env, paste, save.

It wasn't the KINDE sdk. Once I fixed the .env, I was authenticating users in less than 5 mintues by following their excellent docs :
https://docs.kinde.com/developer-tools/sdks/backend/sveltekit-sdk/

Good job Kinde team. A really great product.

Add a reply
Sign up and join the conversation on Slack
Join