![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
use-facebook-auth
Advanced tools
A React based hook for facebook authentication.
$ npm i use-facebook-auth
or
$ yarn add use-facebook-auth
This hook uses context and hooks to provide info throughout your application on wether or not you have an active session. You'll want to wrap your app by doing the following:
import FacebookProvider from 'use-facebook-auth';
const MY_APP_ID = 'xxxxxxxx';
ReactDOM.render(
<React.StrictMode>
<FacebookProvider options={{ appId: MY_APP_ID }}>
<App />
</FacebookProvider>
</React.StrictMode>,
document.getElementById('root')
);
Your App Id is the application you're using too authentcate against. Then on any page you wish to authenticate/logout/get sessino info you can use the following hook:
import { useFacebook } from 'use-facebook-auth';
const loginOptions = {
scope: 'public_profile,email'
}
const MyMethod = () => {
const {
authenticatedSession: { // only comes back when authenticated
accessToken: 'string';
expiresIn: 'number';
signedRequest: 'string';
userID: 'string';
grantedScopes: 'string'; // optional
reauthorize_required_in: 'number'; // optional
},
authenticatedState: 'loading' | 'error' | 'authenticated' | 'unauthenticated',
isAuthenticated: true | false, //derived from the auth state;
loading: true | false, //derived from the auth state;
logout(): void,
login(loginOptions): void
} = useFacebook();
return (<div>Hello</div>);
}
The Provider requires one option, the appId, but you can also pass in language and version if you wish to alter the defaults below:
Parameter | Description |
---|---|
appId | Required The facebook app your authentication associates too. |
version | Default: v8.0 - provide a specific version |
language | Default: en_US - Provide the language you wish to see translations in |
MIT Licensed
FAQs
A React based hook for facebook authentication.
The npm package use-facebook-auth receives a total of 1 weekly downloads. As such, use-facebook-auth popularity was classified as not popular.
We found that use-facebook-auth demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.