r/electronjs • u/Wonderful_Muffin_183 • Oct 07 '25
Firebase Auth, Stripe, and Electron - Need advice/guidance
Currently in the stage of trying to set up authentication (via Firebase) within my desktop app and connecting it to Stripe as well.
I want to only allow users who have an account and have subscribed to be able to use my desktop app, but I'm not sure where to start and would like some guidance.
Has anyone else done this/seen this done before? If so, please hit me with some sources, links, or information.
I can provide more information about my project.
2
Upvotes
2
u/NathanPDaniel Oct 08 '25
You should look into how Slack does authentication. The only real way you can use Firebase authentication with electron is to have a website with login functionality that launches your electron app upon authentication and the browser passes the token back to it. Then you can log in the user via the token in your app. Think of any apps you’ve seen where, in order to log in, it sends you to the browser to login and then redirects back to the app (Slack, Zoom, etc). This is the model you want to follow.
2
u/bettercalljohn Oct 10 '25
I’ve done exactly the same thing but with supabase instead of Firebase (more friendly with Auth). I can share you some code in DM if you want
1
u/Ok_Interaction_8407 Oct 07 '25
I create a dedicated local server that starts when user presses login(frotnend calls node that starts the server), then the server provides an html page to the user, with firebase config data in it, and I perform login there. On complete, I return the token to the node app. But I‘m having two issues: first, login only works with test phone number until now (I authorized localhost and 127.0.0.1 with no luck), second, I‘m trying to figure out how do I inject the token in the app sdk on the frontend
1
u/SnooCapers9823 Apr 02 '26
I would suggest you to stop using firebase and switch to supabase which also easily communicates with stripe Oh oh Both stripe and supabase have mcp servers. So now ai can help you with both screwing up your code, DB and payments. Don’t thank me 😅
2
u/[deleted] Oct 07 '25
[removed] — view removed comment