Registry / auth-security / remix-auth-socials

remix-auth-socials

JSON →
library3.0.0jsnpmunverified

Remix Auth Socials is a utility package designed to simplify the integration of multiple OAuth2 social login strategies with `remix-auth`. Instead of managing various social provider strategies internally, it collates and re-exports existing community-developed `remix-auth-*-strategy` packages, providing a unified `SocialsProvider` enum for easier dynamic routing and button rendering. The current stable version is 3.0.0, though the README marks it as 'broken / beta / use at your own risk' due to ongoing updates for Remix Router v7 compatibility and dropping support for some previously included strategies. The release cadence is irregular, largely driven by updates to the underlying community packages it aggregates. Its key differentiator is providing a single point of reference and a consistent enum for managing a suite of social authentication options within a Remix application, aiming to reduce `package.json` bloat from individual strategy installations while centralizing the usage pattern.

npm install remix-auth-socials
INSTALL
IMPORT
SIG · REMIX-AUTH-SOCIALS
R
remix-auth-socials
auth-securityjavascriptv3.0.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SocialsProvider
import { SocialsProvider } from 'remix-auth-socials';
const SocialsProvider = require('remix-auth-socials').SocialsProvider;
This package is designed for ESM environments, typical in Remix projects. 'SocialsProvider' is an enum used to identify social login types.

This quickstart demonstrates setting up `remix-auth` with a `GoogleStrategy` using `remix-auth-socials`' `SocialsProvider` enum for consistent dynamic routing. It includes an `authenticator` instance, dynamic auth routes (`$provider.tsx`, `$provider.callback.tsx`), a login page with a social button, and a logout action.

import { Authenticator } from 'remix-auth'; import { createCookieSessionStorage } from '@remix-run/node'; import { GoogleStrategy } from 'remix-auth-google'; // Install via 'npm install remix-auth-google' import { Form } from '@remix-run/react'; import { SocialsProvider } from 'remix-auth-socials'; import type { ActionArgs, LoaderArgs } from '@remix-run/node'; // app/server/auth.server.ts const sessionStorage = createCookieSessionStorage({ cookie: { name: '__session', httpOnly: true, path: '/', sameSite: 'lax', secrets: [process.env.SESSION_SECRET ?? 's3cr3t'], secure: process.env.NODE_ENV === 'production', }, }); export const authenticator = new Authenticator<string>(sessionStorage); // Add Google Strategy (example: ensure remix-auth-google is installed) authenticator.use( new GoogleStrategy( { clientID: process.env.GOOGLE_CLIENT_ID ?? '', clientSecret: process.env.GOOGLE_CLIENT_SECRET ?? '', callbackURL: 'http://localhost:3000/auth/google/callback', }, async ({ profile }) => { // Here you can return the user info from your database or create a new user return profile.emails[0].value; } ), SocialsProvider.GOOGLE // Use the enum for consistency ); // app/routes/auth/$provider.tsx export let loader = () => new Response('Login via social provider', { status: 404 }); export let action = ({ request, params }: ActionArgs) => { if (!params.provider) throw new Response('Provider missing', { status: 400 }); return authenticator.authenticate(params.provider, request); }; // app/routes/auth/$provider.callback.tsx export let callbackLoader = ({ request, params }: LoaderArgs) => { if (!params.provider) throw new Response('Provider missing', { status: 400 }); return authenticator.authenticate(params.provider, request, { successRedirect: '/dashboard', failureRedirect: '/login', }); }; // app/routes/login.tsx interface SocialButtonProps { provider: SocialsProvider; label: string; } const SocialButton: React.FC<SocialButtonProps> = ({ provider, label }) => ( <Form action={`/auth/${provider}`} method="post"> <button type="submit">{label}</button> </Form> ); export default function Login() { return ( <div style={{ fontFamily: 'system-ui, sans-serif', lineHeight: '1.8' }}> <h1>Login</h1> <SocialButton provider={SocialsProvider.GOOGLE} label="Login with Google" /> {/* Add other available social buttons here, e.g., GitHub, Facebook */} <Form action="/logout" method="post"> <button type="submit">Logout</button> </Form> </div> ); } // app/routes/logout.tsx export let logoutAction = async ({ request }: ActionArgs) => { return authenticator.logout(request, { redirectTo: '/login' }); };
Debug
Known issues
breakingVersion 3.0.0 of `remix-auth-socials` introduces significant breaking changes by dropping several social authentication strategies (Discord, LinkedIn, X/Twitter) that are incompatible with Remix Router v7. If you relied on these providers, you must either downgrade or find alternative implementations.
fix
Review the 'Currently Unavailable in V3' list in the README. For dropped strategies, consider implementing them directly with `remix-auth` using their respective individual packages (if updated for RR7) or explore other authentication methods. For included strategies, ensure they are compatible with your Remix Router version.
affects: >=3.0.0
gotchaThe package owner states that V3 is 'considered broken / beta / use at your own risk' and that 'Facebook and Google are untested as of yet'. This indicates potential instability and lack of full verification for critical features.
fix
Exercise caution when deploying V3 to production. Thoroughly test all integrated social strategies, especially Google and Facebook. Monitor the GitHub repository for updates and bug fixes, or consider contributing to stability efforts if critical for your application.
affects: >=3.0.0
gotchaMaintenance of `remix-auth-socials` is described as infrequent ('I dont maintain this super often'). This may lead to slower bug fixes, delayed updates for new Remix versions, or lack of support for new social provider features.
fix
Be prepared to manage or contribute to the package yourself for critical issues or to keep up with ecosystem changes. For long-term projects requiring highly stable and actively maintained social authentication, consider integrating individual `remix-auth-*-strategy` packages directly or building custom strategies.
affects: *
gotcha`remix-auth-socials` primarily acts as a collator and provides the `SocialsProvider` enum. The actual social authentication strategies (e.g., `GoogleStrategy`) are sourced from independent community packages. You must install these individual `remix-auth-*-strategy` packages separately.
fix
Ensure that for every social provider you intend to use, you have explicitly installed its corresponding `remix-auth-*-strategy` package (e.g., `npm install remix-auth-google`) in addition to `remix-auth-socials` itself. Refer to the 'The Collection' section of the `remix-auth-socials` README for links to the individual strategy packages.
affects: >=2.0.0
Errors
Common errors & fixes
Error: Strategy 'YOUR_PROVIDER_NAME' is not defined. Did you forget to add it to the authenticator?
You are attempting to authenticate with a social provider using `params.provider` (e.g., `SocialsProvider.DISCORD`) that has not been added to your `Authenticator` instance via `authenticator.use(new DiscordStrategy(...), SocialsProvider.DISCORD);` in `auth.server.ts`.
fix
Ensure that every `SocialsProvider` enum value used in your frontend buttons has a corresponding `authenticator.use()` call in your `auth.server.ts` (or equivalent file), properly instantiating the relevant `remix-auth-*-strategy` package.
Error: Cannot find module 'remix-auth-google' or its corresponding type declarations.
You are trying to import a specific social strategy (e.g., `GoogleStrategy`) in your `auth.server.ts` without having installed its dedicated package.
fix
Install the required individual strategy package for each social provider you intend to use. For example, for Google, run `npm install remix-auth-google`. Remember that `remix-auth-socials` itself does not bundle these strategies.
TypeError: (0 , remix_auth_socials__WEBPACK_IMPORTED_MODULE_1__.SocialsProvider) is not a function
This error typically occurs when trying to use `SocialsProvider` as if it were a function or class constructor. `SocialsProvider` is an enum (an object with string values), not a callable entity.
fix
Access enum members directly, e.g., `SocialsProvider.GOOGLE` or `SocialsProvider.GITHUB`. Ensure you are not trying to instantiate it or call it like `SocialsProvider()`.
Upgrade
Version history
3.0.0latest on npm
Audit
Dependencies
remix-authrequiredCore authentication library that this package extends with social strategies.
remix-auth-discordoptionalSpecific social authentication strategy; currently unavailable in v3.
remix-auth-facebookoptionalSpecific social authentication strategy.
remix-auth-githuboptionalSpecific social authentication strategy.
remix-auth-googleoptionalSpecific social authentication strategy.
remix-auth-microsoftoptionalSpecific social authentication strategy.
remix-auth-twitteroptionalSpecific social authentication strategy; currently unavailable in v3 (OAuth1 & 2 updates in v2.1.0, but dropped in v3).
remix-auth-linkedinoptionalSpecific social authentication strategy; currently unavailable in v3.
Agent activity
9 hits · last 30 days
node
8
OpenAI (training)
1
Resources