{"id":4708,"url":"https://github.com/adamjmcgrath/react-native-simple-auth","last_synced_at":"2025-08-04T02:31:25.499Z","repository":{"id":31884160,"uuid":"35452812","full_name":"adamjmcgrath/react-native-simple-auth","owner":"adamjmcgrath","description":"OAuth login for React Native","archived":true,"fork":false,"pushed_at":"2021-08-04T05:36:46.000Z","size":13132,"stargazers_count":668,"open_issues_count":19,"forks_count":105,"subscribers_count":23,"default_branch":"master","last_synced_at":"2025-07-09T14:46:48.127Z","etag":null,"topics":["oauth","react-native"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adamjmcgrath.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-11T22:11:32.000Z","updated_at":"2025-04-01T17:32:15.000Z","dependencies_parsed_at":"2022-09-10T16:20:49.187Z","dependency_job_id":null,"html_url":"https://github.com/adamjmcgrath/react-native-simple-auth","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/adamjmcgrath/react-native-simple-auth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamjmcgrath%2Freact-native-simple-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamjmcgrath%2Freact-native-simple-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamjmcgrath%2Freact-native-simple-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamjmcgrath%2Freact-native-simple-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adamjmcgrath","download_url":"https://codeload.github.com/adamjmcgrath/react-native-simple-auth/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamjmcgrath%2Freact-native-simple-auth/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267454920,"owners_count":24089958,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["oauth","react-native"],"created_at":"2024-01-05T20:17:20.918Z","updated_at":"2025-08-04T02:31:24.781Z","avatar_url":"https://github.com/adamjmcgrath.png","language":"JavaScript","funding_links":[],"categories":["Components","JavaScript"],"sub_categories":["Backend"],"readme":"# react-native-simple-auth [![Build Status](https://travis-ci.org/adamjmcgrath/react-native-simple-auth.svg?branch=chore%2Frelease-tasks)](https://travis-ci.org/adamjmcgrath/react-native-simple-auth)\n\n## OAuth login for React Native\n\n  * [Screencast](#screencast)\n  * [Install](#install)\n  * [Providers Setup](#providers-setup)\n  * [Usage](#usage)\n  * [License](#license)\n\nScreencast\n==========\n\niOS             |  Android\n:-------------------------:|:-------------------------:\n![Screencast](https://raw.githubusercontent.com/adamjmcgrath/react-native-simple-auth/master/screencast-ios.gif) |  ![Screencast](https://raw.githubusercontent.com/adamjmcgrath/react-native-simple-auth/master/screencast-android.gif)\n\nSource of example app: https://github.com/adamjmcgrath/ReactNativeSimpleAuthExample\n\nInstall\n=======\n- `yarn add react-native-simple-auth`\n- Set up deep linking for your Android and iOS application using the instructions on the [react-native website](https://facebook.github.io/react-native/docs/linking.html) (set the `launchMode` of `MainActivity` to `singleTask` in `AndroidManifest.xml`, create the deep link schemes in [Providers Setup](#providers-setup))\n- Set up your OAuth Providers\n\nProviders Setup\n===============\n\n### Google\n- Go to the [developer console](https://console.cloud.google.com/apis/credentials/oauthclient/) and create credentials for an iOS application (you can also use these for your Android app). More [instructions](https://support.google.com/cloud/answer/6158849) on the Google support site.\n- The \"Bundle ID\" should contain a dot, eg `com.reactnativesimpleauth`\n- Your configuration object should contain the 'Client ID' as `appId` and 'Bundle ID' in the `callback` (note the single `/`, you can put anything as the path), eg\n```js\n{\n  appId: '123-123abc.apps.googleusercontent.com',\n  callback: 'com.reactnativesimpleauthexample:/oauth2redirect'\n}\n```\n- Add the deep link scheme for the callback (Your Bundle ID, eg `com.reactnativesimpleauthexample`) to your `AndroidManifest.xml` eg https://github.com/adamjmcgrath/ReactNativeSimpleAuthExample/blob/master/android/app/src/main/AndroidManifest.xml#L28-L33\n- Add the deep link scheme for the callback to your iOS app, eg https://dev.twitter.com/cards/mobile/url-schemes\n\n### Facebook\n- Create an app on the [Facebook developers](https://developers.facebook.com) website\n- In `Settings`, click `Add Platform`\n- Select iOS, and in the `Bundle ID` field, add `fb{your App ID}` eg `fb1234567890` (You can use the same configuration for Android)\n- Your configuration object should contain the 'Appid ID' as `appId` and 'Bundle ID' in the `callback` (you must put `://authorize`), eg\n```js\n{\n  appId: '1234567890',\n  callback: 'fb1234567890://authorize',\n  scope: 'user_friends', // you can override the default scope here\n  fields: ['email', 'first_name', 'last_name'], // you can override the default fields here\n}\n```\n- Add the deep link scheme for the callback (Your Bundle ID, eg `fb1234567890`) to your `AndroidManifest.xml` eg https://github.com/adamjmcgrath/ReactNativeSimpleAuthExample/blob/master/android/app/src/main/AndroidManifest.xml#L28-L33\n- Add the deep link scheme for the callback to your iOS app, eg https://dev.twitter.com/cards/mobile/url-schemes (Due to A Facebook bug, this should always be the top one in the list)\n\n### Twitter\n- Create an app on https://apps.twitter.com\n- You can put any valid URL as the callback url.\n- Your configuration object should contain the 'Consumer Key (API Key)' as `appId`, the 'Consumer Secret' as `appSecret` and the Twitter `App name` in the `callback`, eg\n```js\n{\n  appId: 'abc1234567890',\n  appSecret: 'cba0987654321',\n  callback: 'testapp://authorize',\n}\n```\n- Add the deep link scheme for the callback (Your App Name, eg `testapp`) to your `AndroidManifest.xml` eg https://github.com/adamjmcgrath/ReactNativeSimpleAuthExample/blob/master/android/app/src/main/AndroidManifest.xml#L28-L33\n- Add the deep link scheme for the callback to your iOS app, eg https://dev.twitter.com/cards/mobile/url-schemes (Due to A Facebook bug, this should always be the top one in the list)\n\n### Tumblr\n- Create an app on https://www.tumblr.com/oauth/apps\n- You can put any valid URL as the callback url.\n- Your configuration object should contain the 'OAuth Consumer Key' as `appId`, the 'OAuth Consumer Secret' as `appSecret` and any `callback`, eg\n```js\n{\n  appId: '1234567890abc',\n  appSecret: '1234567890abc',\n  callback: 'testapp://authorize',\n}\n```\n- Add the deep link scheme for the callback (Your App Name, eg `testapp`) to your `AndroidManifest.xml` eg https://github.com/adamjmcgrath/ReactNativeSimpleAuthExample/blob/master/android/app/src/main/AndroidManifest.xml#L28-L33\n- Add the deep link scheme for the callback to your iOS app, eg https://dev.twitter.com/cards/mobile/url-schemes (Due to A Facebook bug, this should always be the top one in the list)\n\n### Untappd\n- Create an app on https://untappd.com/api/register\n- Use a custom app prefix for the callback url.\n- Your configuration object should contain the app id and your callback url e.g.\n```js\n{\n  appId: '123456789',\n  callback: 'testapp://authorize',\n}\n```\n- Register your deep link scheme with android and ios as described for other apps.\n\nUsage\n=====\n\nCreate a configuration object for each of the providers you want to authorize with (required keys are in parenthesis):\n\n - google (`appId`, `callback`)\n - facebook (`appId`, `callback`)\n - twitter (`appId`, `appSecret`, `callback`)\n - tumblr (`appId`, `appSecret`, `callback`)\n\nSee [secrets.example.js](https://github.com/adamjmcgrath/ReactNativeSimpleAuthExample/blob/master/secrets.example.js).\n\n```javascript\nimport { google, facebook, twitter, tumblr } from 'react-native-simple-auth';\n\ngoogle({\n  appId: '123-123abc.apps.googleusercontent.com',\n  callback: 'com.reactnativesimpleauthexample:/oauth2redirect',\n}).then((info) =\u003e {\n  // info.user - user details from the provider\n  // info.credentials - tokens from the provider\n}).catch((error) =\u003e {\n  // error.code\n  // error.description\n});\n```\n\nLicense\n=======\n\nreact-native-simple-auth is released under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamjmcgrath%2Freact-native-simple-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadamjmcgrath%2Freact-native-simple-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamjmcgrath%2Freact-native-simple-auth/lists"}