Facebook

Integrate Facebook Single Sign-On (SSO) in your application.

Create a new application

Click on the Create App button to create a new application.

Add use cases

Chose Authenticate and request data from users with Facebook Login as the use case.

Get the App ID and App Secret

After creating the application, go to Settings => Basic to get the App ID and App Secret. Save them for later.

Environment Variables (.env)

Add the App ID and App Secret to your .env file.

FACEBOOK_CLIENT_ID={app-id}
FACEBOOK_CLIENT_SECRET={app-secret}

Configuration in VitNode

Add the Facebook SSO plugin to your API routes.

src/app/api/[...route]/route.ts
import { FacebookSSOApiPlugin } from 'vitnode/api/plugins/sso/facebook';
 
VitNodeAPI({
  app,
  plugins: [],
  authorization
    ssoPlugins: [
      new FacebookSSOApiPlugin({
        clientId: process.env.FACEBOOK_CLIENT_ID,
        clientSecret: process.env.FACEBOOK_CLIENT_SECRET,
      }),
    ],
  },
});

On this page