NewCode with Beto MCP

Sign In with GitHub and Firebase Auth | React Native Expo 49 | TypeScript

Beto, August 12, 2023 · 5,664 views

If your app is built for developers, GitHub sign-in is the login they actually want. I build the full flow in the video with Firebase Auth, Expo SDK 49, TypeScript, and Expo Router: OAuth app setup on GitHub, provider config in Firebase, and the token exchange code that ties it together. Sessions persist across restarts, and it runs on both iOS and Android emulators.

You'll also see how to keep your client ID and secret out of source control with environment variables.

What's inside

  • Create a GitHub OAuth app and grab the client ID and secret
  • Enable the GitHub provider in Firebase Authentication
  • Handle the OAuth redirect and exchange the code for a token in TypeScript
  • Keep credentials safe with a file in Expo
  • Persist sessions and wire up clean sign-out behavior
  • Request extra GitHub scopes beyond basic auth, like repo access

Resources

CourseReact Native course

Let's connect!

Had a win? Get featured on Code with Beto.Share your story