Skip to content

Universal Social AuthSocial login for the browser

OAuth 1.0, OAuth 2.0, and OIDC with PKCE, state checks, and lifecycle hooks. Your backend keeps the client secret.

universal-social-auth logo

npm versiondownloadsGitHub starslicenseGitHub

Install in seconds ​

bash
npm install universal-social-auth axios
bash
pnpm add universal-social-auth axios
bash
yarn add universal-social-auth axios

See it in code ​

ts
import axios from 'axios';
import UniversalSocialauth from 'universal-social-auth';

const auth = new UniversalSocialauth(axios, {
  providers: {
    google: {
      url: '/api/auth/google',
      clientId: 'YOUR_PUBLIC_CLIENT_ID',
      redirectUri: `${window.location.origin}/callback`
    }
  }
});
bash
# Your backend exchanges the code and keeps the client secret.
# Pick a recipe for your stack:
#   /docs/recipes/express
#   /docs/recipes/laravel
#   /docs/recipes/zintrust

Add an agent to your app ​

Using an AI coding agent? Point it at the agent instructions and it will wire universal-social-auth into your project:

text
Add an agent to my app using instructions from https://usa.zintrust.com/agents.md

Built by Zintrust. universal-social-auth is maintained by the team behind zintrust.com. Explore more of our tools, or read the full documentation at usa.zintrust.com.

Ready to ship? Read the getting started guide, browse the backend recipes, or support the project.

Released under the MIT License. Published by Diadal Nigeria Limited. Part of the Zintrust ecosystem at zintrust.com.