# expo-supabase-social-auth

> Package for supplying Social Authentication (currently Apple & Google) with Supabase and Expo Router V2. [I've written a blog post](https://rnny.nl/blog/expo-supabase-social-auth) that explains the process of setting up and configuring Google and Apple lo

Latest version **1.0.4** (published 2023-07-28) · 0 weekly downloads

## Install

```sh
npm install expo-supabase-social-auth
pnpm add expo-supabase-social-auth
yarn add expo-supabase-social-auth
bun add expo-supabase-social-auth
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2023-07-28 |
| First published | 2023-07-26 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 15.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | rnnyrk |

## Links

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

## Dependencies (7)

- [expo](https://npm.io/package/expo.md) ^49.0.3
- [react](https://npm.io/package/react.md) ^18.2.0
- [jwt-decode](https://npm.io/package/jwt-decode.md) 3.1.2
- [expo-router](https://npm.io/package/expo-router.md) ^2.0.1
- [react-native](https://npm.io/package/react-native.md) ^0.72.2
- [expo-web-browser](https://npm.io/package/expo-web-browser.md) ~12.3.2
- [@supabase/supabase-js](https://npm.io/package/@supabase/supabase-js.md) 2.26.0

## Recent versions

- 1.0.4 (latest) — 2023-07-28
- 1.0.3 — 2023-07-26
- 1.0.2 — 2023-07-26
- 1.0.1 — 2023-07-26

## README

# expo-supabase-social-auth

Package for supplying Social Authentication (currently Apple & Google) with Supabase and Expo Router V2. [I've written a blog post](https://rnny.nl/blog/expo-supabase-social-auth) that explains the process of setting up and configuring Google and Apple logins with Supabase.

[Also created an example repository to quickly get started](https://github.com/rnnyrk/expo-router-supabase-social-auth).

## Dependencies

This package requires the following dependencies:

- [SupabaseJS](https://supabase.com/docs/reference/javascript/installing)
- [Expo Router V2](https://docs.expo.dev/routing/introduction/)
- [Google/Apple authentication setup](https://rnny.nl/blog/expo-supabase-social-auth)

## Usage

```tsx
// app/index.tsx
import { useSupabaseSocialAuth } from 'expo-supabase-social-auth';

export default function AuthScreen() {
  const { loading, onSignInWithApple, onSignInWithGoogle } = useSupabaseSocialAuth();

  return (
    <SupabaseSocialAuthProvider
      onLoginError={() => {}}
      onLoginSuccess={() => {}}
      applicationId={applicationId!}
      loggedInRoute="/home/"
      loggedOutRoute="/"
      supabaseClient={supabase}
    >
      {children}
    </SupabaseSocialAuthProvider>
  );
}
```

### Props

| Method           | Type                             | Description                                                                                |
| ---------------- | -------------------------------- | ------------------------------------------------------------------------------------------ |
| `applicationId`  | `string`                         | bundleId/packageName as e.g. `com.test`                                                    |
| `loggedInRoute`  | `string`                         | Internal route (Expo app dir) to redirect to after successful login                        |
| `loggedOutRoute` | `string`                         | Internal route (Expo app dir) to redirect to after logout                                  |
| `onLoginError`   | `(error: unknown) => void`       | Callback function after login error                                                        |
| `onLoginSuccess` | `(payload: AuthTokens) => void)` | Callback function after login success                                                      |
| `supabaseClient` | `SupabaseClient`                 | [Supabase initialized client](https://supabase.com/docs/reference/javascript/initializing) |

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