Chrome extension / Reat Native Desktop #443

Closed
opened 2026-03-13 07:46:18 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @nikolaigeorgie on GitHub (Dec 20, 2024).

Just curious what the recommendations would be for adding better auth to react native macos and a react chrome extension. I have a turbo repo sharing auth with my next js and expo app (works great!), just wanted to add macos and chrome extension as well.

My thoughts were
Chrome Extension
Follow the next js client docs for session management.

React Native Desktop
Expo isn't compatible in any way with react native desktop so this would is rather tricky!

Thanks in advance

Originally created by @nikolaigeorgie on GitHub (Dec 20, 2024). Just curious what the recommendations would be for adding better auth to react native macos and a react chrome extension. I have a turbo repo sharing auth with my next js and expo app (works great!), just wanted to add macos and chrome extension as well. My thoughts were **Chrome Extension** Follow the next js client docs for session management. **React Native Desktop** Expo isn't compatible in any way with react native desktop so this would is rather tricky! Thanks in advance
Author
Owner

@Bekacru commented on GitHub (Dec 21, 2024):

I'm not very familiar with Chrome extensions. They might work with the default cookie-based setup, but if they don't, you can use the bearer plugin and send the session token as a bearer token.

@Bekacru commented on GitHub (Dec 21, 2024): I'm not very familiar with Chrome extensions. They might work with the default cookie-based setup, but if they don't, you can use the bearer plugin and send the session token as a bearer token.
Author
Owner

@nikolaigeorgie commented on GitHub (Dec 31, 2024):

@Bekacru just wanted to confirm that works! Calling the better auth sdk doesn't work for web because of cors issues (I've tried setting all /specific cors for next js and better auths config file.. but calling fetch directly like this returns a token 🙏

 await fetch('http://localhost:3000/api/auth/sign-up/email?currentURL=http://localhost:5173', {
        method: 'POST',
        headers: {
          'content-type': 'application/json',
          Referer: 'http://localhost:5173/',
        },
        body: JSON.stringify({
          email: 'test@test.com',
          password: 'Password',
          name: 'Test',
        }),
      })
@nikolaigeorgie commented on GitHub (Dec 31, 2024): @Bekacru just wanted to confirm that works! Calling the better auth sdk doesn't work for web because of cors issues (I've tried setting all /specific cors for next js and better auths config file.. but calling fetch directly like this returns a token 🙏 ``` await fetch('http://localhost:3000/api/auth/sign-up/email?currentURL=http://localhost:5173', { method: 'POST', headers: { 'content-type': 'application/json', Referer: 'http://localhost:5173/', }, body: JSON.stringify({ email: 'test@test.com', password: 'Password', name: 'Test', }), }) ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#443