# social-auth-js

> Social Authentication library for JavaScript

Latest version **1.0.0** (published 2024-01-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install social-auth-js
pnpm add social-auth-js
yarn add social-auth-js
bun add social-auth-js
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2024-01-29 |
| First published | 2023-10-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 150.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | VyLQ |
| Maintainers | svenit |
| Keywords | social auth, social auth js, facebook login js, google login js, github login js |

## Links

- npm: https://www.npmjs.com/package/social-auth-js
- npm.io page: https://npm.io/package/social-auth-js

## Dependencies (1)

- [graceful-fs](https://npm.io/package/graceful-fs.md) ^4.1.15

## Alternatives

- [@clerk/clerk-expo](https://npm.io/package/@clerk/clerk-expo.md) — 133.6K weekly downloads
- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2024-01-29
- 0.0.5 — 2023-10-23
- 0.0.4 — 2023-10-23
- 0.0.3 — 2023-10-23
- 0.0.2 — 2023-10-23
- 0.0.1 — 2023-10-23

## README

# Social Auth JS

Intends to provide reusable components that will allow you to access the login flow for several social platforms, some will work as standalone frontend components, others will need some type of backend support.

##### Platforms
- Facebook
- Google
- Github
- Instagram
- Twitter
- Bitbucket
- Linkedin
- Vkontakte
- Live

#### Install
Using NPM
```sh
npm i social-auth-js
```
or using Yarn
```sh
yarn add social-auth-js
```

#### Using
```js
import SocialAuthJS from 'social-auth-js'
import axios from 'axios'

const socialAuth = new SocialAuthJS(axios, {
    providers: {
      facebook: {
        clientId: 'YOUR_CLIENT_ID',
        redirectUri: 'YOUR_REDIRECT_URL',
      },
      google: {
        clientId: 'YOUR_CLIENT_ID',
        redirectUri: 'YOUR_REDIRECT_URL',
      },
    },
 });
 socialAuth.authenticate('facebook').then((res) => {
     // res will return callback token
     // call api to verify token and get user information
     // If you are using Laravel, you can easily use https://laravel.com/docs/10.x/socialite for authenticate
 });
```

---
_Source: https://npm.io/package/social-auth-js · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
