Browser-first
One client instance. Popup or redirect flow. No client secret in the browser.
OAuth 1.0, OAuth 2.0, and OIDC with PKCE, state checks, and lifecycle hooks. Your backend keeps the client secret.

npm install universal-social-auth axiospnpm add universal-social-auth axiosyarn add universal-social-auth axiosimport 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`
}
}
});# Your backend exchanges the code and keeps the client secret.
# Pick a recipe for your stack:
# /docs/recipes/express
# /docs/recipes/laravel
# /docs/recipes/zintrustUsing an AI coding agent? Point it at the agent instructions and it will wire universal-social-auth into your project:
Add an agent to my app using instructions from https://usa.zintrust.com/agents.mdBuilt 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.