Socket
Book a DemoInstallSign in
Socket

@openmobilehub/auth-facebook

Package Overview
Dependencies
Maintainers
0
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@openmobilehub/auth-facebook

React Native OMH Auth - Facebook simplifies Facebook authentication integration into React Native applications.

1.0.6
latest
Source
npmnpm
Version published
Weekly downloads
16
1500%
Maintainers
0
Weekly downloads
 
Created
Source


React Native OMH Auth - Facebook

NPM downloads NPM version License

Chat on Discord Follow on Twitter

Installation

npm add @openmobilehub/auth-facebook

Configuration

:::info[Prerequisites]

Each plugin requires you to follow the iOS and Android configuration prior to interacting with it.

:::

Console App

To access Google APIs, please follow these steps in order to obtain the Client ID:

  • Create a new app in Meta for Developers.
  • Add the Android platform and specify your Key Hash for your app.
  • Enable the email permission for your app.

Android

Add a new entry to your android/local.properties file:

FACEBOOK_CLIENT_ID=<YOUR_FACEBOOK_APP_ID>
FACEBOOK_CLIENT_SECRET=<YOUR_FACEBOOK_APP_SECRET>

Usage

Initializing

Before interacting with Facebook, initialization of the Facebook Auth Client is necessary, requiring platform specific configuration to be set.

import FacebookAuthClient from '@openmobilehub/auth-facebook';

await FacebookAuth.initialize({
  android: {
    scopes: ['public_profile', 'email'],
  },
  ios: {
    scopes: ['public_profile', 'email'],
    clientId: '<YOUR_FACEBOOK_APP_ID>',
    clientSecret: '<YOUR_FACEBOOK_APP_SECRET>',
    redirectUrl: `fb${'<YOUR_FACEBOOK_APP_ID>'}://authorize/`,
  },
});

Other methods

Interacting with the Facebook provider follows the same pattern as other providers since they all implement the IAuthModule interface. For a comprehensive list of available methods, refer to the Quick Start guide.

License

FAQs

Package last updated on 09 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.