# Social Sign On

In addition to enabling your users to sign on with their email and password, Gravity supports signing in with social networks using [Passport.js](http://www.passportjs.org) (Node.js version) or [Arctic](https://arcticjs.dev/) (Next.js version).

## Configuring Facebook

In order to sign in with Facebook, you will need to create an app in the [Facebook developer portal](https://developers.facebook.com/apps) and add your app ID and secret to the .env file (you'll be asked to do this during setup, or you can add it manually later).

Please [follow the Facebook documentation](https://developers.facebook.com/docs/development/create-an-app) for the latest guidance on how to do this.

## Configuring Twitter

As with Facebook, you will need to create an app in the [Twitter developer portal](https://developer.twitter.com/apps) and add your app ID and secret to the .env file.

Please [follow the Twitter documentation](https://developer.twitter.com/en/docs/apps/overview) for the latest guidance on how to do this.

## Callback URLs

The default callback URLs are defined in the config file, and follow this structure:

```javascript
http://localhost:8080/auth/facebook/callback
```

You will need to add the callback URL to the authorised endpoints in the developer portal for your chosen social network.

## Disable the Social Sign-Ons

If you'd like to disable social sign-ons, remove the `<SocialSignin/>` component from the auth views in the client to remove the buttons and then disable the API endpoints.

## Using Social Sign Ons with Gravity Native

To use social sign-ons with Gravity Native on your mobile device, you will need to install ngrok instead of using localhost in your callback URLs.

Please [follow the getting started guide on ngrok](https://ngrok.com/docs/getting-started/) to set it up.

{% hint style="warning" %}
Please update the `callback_url` inside the `/config` folder files and **ALSO** the `baseURL` value inside `app/config.json`
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.usegravity.app/gravity-server/authentication/social-sign-on.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
