> ## Documentation Index
> Fetch the complete documentation index at: https://docs.median.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Website configuration

> Connect your existing website login buttons to native Facebook, Google, and Apple sign-in with the Median JavaScript Bridge.

Configure your website to enable social login using the Median JavaScript Bridge.

This guide is for developers who've already set up social login ([Facebook](https://docs.median.co/docs/facebook-login-configuration.md), [Google](https://docs.median.co/docs/google-sign-in-configuration.md), or [Apple](https://docs.median.co/docs/sign-in-with-apple-configuration.md)) on their website and want to add Median's Social Login plugin for a native app experience.

> [!TIP]
>
> **Test  with our demo page**
>
> We host a ready-made demo page at
>
> that calls the  features through the Median JavaScript Bridge.
> Load it inside your Median app during development, either by setting it
> as your app's website URL in App Studio or by navigating to it from your
> own site, and use it to confirm  works on a real device before
> you add it to your own pages.
>
> The demo page only works inside a Median app with  enabled.
> Opened in a regular mobile or desktop browser, the native features
> won't respond. Remember to switch your app back to your own URL before
> release.

## How it works

You'll use the Median JavaScript Bridge methods to trigger native login flows for each social provider. These methods only work when your website is running inside your app, not in a regular browser.

The plugin works with your current authentication infrastructure, using the same API endpoints or JavaScript callback functions you already have for browser-based login. Whether you set up server-side redirects or client-side JavaScript callbacks, the plugin taps into your existing authentication flow without needing to rebuild your backend.

Here's the approach:

* Show your standard login buttons when users visit your site in a browser.
* Show the same buttons with modified JavaScript functionality that calls the JavaScript Bridge methods when they visit through your app (no styling changes needed).

### Example implementation

Here's how to set this up with JavaScript:

Median JavaScript Bridge

```html HTML theme={null}
<button class="facebook-login browser-only" onclick="facebookLogin()">
	Log In With Facebook
</button>

<button
class="facebook-login native-only"
onclick="median.socialLogin.facebook.login({ 'redirectUri' : 'https://median-social-logins-demo.web.app/auth/facebook/redirect', 'scope' : 'public_profile, email' });"
>
Log in With Facebook
</button>

<script>
const isMedian = navigator.userAgent.indexOf("median") >= 0;

if (isMedian) {
    	// Remove browser-only buttons
    	const elements = document.getElementsByClassName("browser-only");
    	while (elements.length > 0) {
        	elements[0].parentNode.removeChild(elements[0]);
    	}
} else {
    	// Remove native-only buttons
    	const elements = document.getElementsByClassName("native-only");
    	while (elements.length > 0) {
        	elements[0].parentNode.removeChild(elements[0]);
    	}
}
</script>

```


## Related topics

- [Clear WebView cache](https://docs.median.co/docs/clear-webview-cache.md)
- [Facebook Login configuration](https://docs.median.co/docs/facebook-login-configuration.md)
- [Social login overview](https://docs.median.co/docs/social-login.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.