# Sign in with Apple and Google in the Pro app kit (Pro)

> Set up Sign in with Apple and Sign in with Google in a Patine Pro app kit app for iOS, Android and the web: the client IDs in patine.config.js, Apple's Services ID for Android and the web, Google's OAuth clients, and the adapter's signInWith on mock, HTTP and Supabase backends.

# Kit: Sign in with Apple and Google Pro

Every kit app's sign-in and sign-up screens lead with **Continue with Apple** and **Continue with Google**, full width in each brand's own button style, then "or continue with email" and the form. Each button spins while it works; a cancel does nothing, and a failure says so under the buttons. Both end in your backend adapter's `signInWith(provider, { idToken })`.

On the **mock** backend (the live demos) both buttons work with no setup: after a short wait they sign in to the demo account. For a real backend, add the client IDs below.

## Turn them on

```js title="patine.config.js"
auth: {
  required: true,
  providers: ['apple', 'google'],
  social: {
    google: {
      iosClientId: '…apps.googleusercontent.com',
      androidClientId: '…apps.googleusercontent.com',
      webClientId: '…apps.googleusercontent.com',
    },
    // Only for Apple on Android and the web; iOS uses the native sheet
    apple: { servicesId: 'dev.example.penny.web', redirectUri: 'https://penny.example.com/auth/apple' },
  },
},
```

A button shows only where it can work: Apple natively on iOS, and on Android and the web when `social.apple` is set; Google on each platform that has its client ID.

## Apple

1. In the Apple Developer portal, turn on **Sign in with Apple** for the app's identifier. The kit sets `ios.usesAppleSignIn` in `app.config.ts`, so your build gets the capability. Expo Go signs in with Apple as it is.
2. For Android and the web, create a **Services ID**, turn on Sign in with Apple for it, and add your domain and the return URL. Put both in `social.apple`.

## Google

1. In Google Cloud, create an OAuth consent screen, then an **OAuth client ID** per platform: iOS (the bundle ID, `dev.patine.<slug>` until you change it), Android (the package name and your signing key's SHA-1) and Web (your site's origin and redirect URL).
2. Put the three IDs in `social.google`. The app opens Google's page in the system browser and gets an ID token back.

## Your backend

The adapter receives the ID token: verify it with Apple's or Google's public keys before you trust it.

| Backend | What `signInWith` does |
| --- | --- |
| Mock | Signs in to the account with that email, or creates one |
| HTTP | `POST /auth/social` with `{ provider, idToken, name?, email? }`; expects a session back |
| Supabase | `signInWithIdToken({ provider, token })`; turn on the Apple and Google providers in Supabase Auth |

## Related

- [Sign in block](/docs/blocks/sign-in) PRO
- [AI assistant](./ai-assistant) PRO
