K
Kinde•2mo ago
kisonay

Kinde and Supabase without SSR

I'm following along https://kinde.com/blog/engineering/kinde-with-supabase/ but my application is client side (no server side rendering.) Is it sill possible to use Kinde in this setup? It would be great if I could authenticate with Kinde and then just have the Supabase client work. Any tips/suggestions would be appreciated.
Kinde Blog
Kinde with Supabase
Learn how to integrate Kinde authentication with Supabase, utilizing PostgreSQL's Row Level Security (RLS) policies.
6 Replies
Oli - Kinde
Oli - Kinde•2mo ago
Hey @kisonay, Sorry for the delayed response. Yes, it is possible to use Kinde with a client-side application. Kinde supports authentication for single-page applications (SPAs) and other client-side apps. For client-side applications, Kinde uses the Authorization Code Flow with Proof Key for Code Exchange (PKCE). This method is secure for applications that run in unsecured environments like web browsers. To integrate Kinde with your client-side application: 1. In Kinde, set up a "Front-end and mobile" application. 2. Configure your callback URLs in the Kinde dashboard. 3. Use one of Kinde's front-end SDKs (such as JavaScript, React, or TypeScript) to implement authentication. After authenticating with Kinde, you would receive an access token. You could then use this token to authenticate requests to your Supabase client. Let me know if you have any further questions on this.
kisonay
kisonayOP•2mo ago
Thanks @Oli - Kinde , so in this case, it wouldn't just automatically work (as indicated in the blog post) I would have to explicitly create the supabase client with appropriate header? and what if the token refreshes? I'll have to monitor and re-initiate the supabase client? Also, how will supabase be able decode the token without a synced secret?
Oli - Kinde
Oli - Kinde•2mo ago
Hey @kisonay, The following video will help you understand more about integrating Kinde with Supabase: https://youtu.be/E9sN9Wol3GI?feature=shared Please let me know if you still have questions unanswered after watching this video.
Kinde
YouTube
Supabase RLS with Kinde Auth (Next.js)
Set up Kinde with Supabase RLS with Peter.
kisonay
kisonayOP•2mo ago
@Oli - Kinde Thank you, this was a great overview. What I get from this video is that without some sort of backend, to mint my own jwt, I will not be able to use kinde with supabase, which is unfortunate as the application I want to integrate is a pure React client side application.
Oli - Kinde
Oli - Kinde•2mo ago
Hey @kisonay, Unfortunately yes you will need a backend, to parse a JWT to supabase. If you need guidance on that, I would suggest reaching out in the #💬┃general channel. Let me know if there is anything else I can help you with.
kisonay
kisonayOP•2mo ago
@Oli - Kinde Thank you for confirming, I appreciate your time and guidance.
Want results from more Discord servers?
Add your server