SocialLoginConfig
The SocialLoginConfig interface defines the configuration settings for various social login providers supported by Firebase Authentication. It allows you to enable or disable specific providers for your application.
Properties
google:booleanIndicates whether Google Sign-In is enabled.microsoft:booleanIndicates whether Microsoft Sign-In is enabled.facebook:booleanIndicates whether Facebook Sign-In is enabled.apple:booleanIndicates whether Apple Sign-In is enabled.github:booleanIndicates whether GitHub Sign-In is enabled.twitter:booleanIndicates whether Twitter Sign-In is enabled.yahoo:booleanIndicates whether Yahoo Sign-In is enabled.
Usage
The SocialLoginConfig interface is typically used within the main AppConfiguration object to provide social login settings to the application. Components like SignIn consume this configuration to dynamically display social login buttons.
// Example structure within appConfig.json or similar configuration
interface AppConfiguration {
socialLogin: SocialLoginConfig; // Using SocialLoginConfig type here
// ... other config properties
}
const appConfig: AppConfiguration = {
socialLogin: {
google: true,
microsoft: false,
facebook: true,
apple: true,
github: false,
twitter: false,
yahoo: false
},
// ...
};
// In a React component (e.g., SignIn):
import { useConfig } from '@fireact.dev/app';
function SignInPage() {
const { appConfig } = useConfig();
const socialLoginEnabled = appConfig.socialLogin;
return (
<div>
{socialLoginEnabled.google && <button>Sign in with Google</button>}
{socialLoginEnabled.facebook && <button>Sign in with Facebook</button>}
{/* ... other social login buttons */}
</div>
);
}
Related Interfaces/Components
AppConfigurationinterface: Contains thesocialLoginfield of typeSocialLoginConfig.SignIncomponent: UsesSocialLoginConfigto render available social login options.
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.