K
Kinde10mo ago
DopE

Integrating Kinde to Astro

I tried to integrate the kinde authentication to my Astro project using the typescript-sdk the login and logout were working fine but while kindeClient.isAuthenticated() Its giving false can anyone help me with this.
10 Replies
DopE
DopE10mo ago
I tried Implementing react in Astro and used react-sdk but its just showing "loding..." https://github.com/pruthvirajjadhav1/Astro-React Can you tell me what I'm doing wrong.
GitHub
GitHub - pruthvirajjadhav1/Astro-React
Contribute to pruthvirajjadhav1/Astro-React development by creating an account on GitHub.
onderay
onderay10mo ago
Hey @DopE our team member who knows Astro the best will be online in a few hrs to help dig into this for you.
DopE
DopE10mo ago
Sure
marcoskinde
marcoskinde10mo ago
Hi there, we love Astro here at Kinde — both our website and docs are currently built with Astro and we do have an Astro SDK on our to-do list (most likely sometime in Q1 next year). In theory, there are a few ways you could use Kinde in Astro: - Using our JS SDK for a client-side implementation; - Using our TS SDK for both client and server-side; - Using our React SDK with Astro + the Astro React JS integration. We haven’t tried any of those ourselves yet since we plan on rolling out a dedicated Astro SDK in the future but will make sure to let the community know once we do have some working examples. I had a look at the GitHub repo you shared and I had a hard time getting it to work since a lot of those dependencies (including Astro) were a bit outdated, but I managed to put a quick example together here based on the repo you shared.
GitHub
GitHub - marcosmartini/kinde-astro-react-test
Contribute to marcosmartini/kinde-astro-react-test development by creating an account on GitHub.
DopE
DopE10mo ago
Thanks alot its woking, I tried to access token aswell and it working. But my issue is I'm trying to make it multipage /login it will reditect to Kinde and for /logout it will logout. Now I tried doing this but its not working its some how loosing the token if i signin from /login and after login redirect to home route then i cant access token. I would really appriciate if you could give it a try and solve this. I'm really excited to intigrate it into my application.
marcoskinde
marcoskinde10mo ago
Hey @DopE , you're right, the example I shared will work as long as you keep everything under one astro page as a React app — it won't work as a multi-page one. We will invest some time to focus on Astro + Kinde sometime during Q1 next year and the idea is to either come up with an Kinde Astro SDK or a native official Kinde integration for Astro. Sorry for not having an workaround for now, we'll make sure to make an announcement once we have something more substantial. Thanks!
DopE
DopE10mo ago
Is there no way to create it for multipage beacause I created my whole application I just want to integrate Kinde
marcoskinde
marcoskinde10mo ago
Hey @DopE, I see you mentioned you tried the TS SDK approach and login/logout was working, but not isAuthenticated - can you share the code you have for that so I can take a look?
DopE
DopE10mo ago
@marcoskinde did you checked this repo
Want results from more Discord servers?
Add your server