---
title: Migrating from Sign in with Google
---

# Migrating from Sign in with Google

The Little X Little JS SDK API is intentionally a near drop-in for [Google Identity Services](https://developers.google.com/identity/gsi/web/guides/overview). In most cases you only change the script URL and the global namespace.

## Diff at a glance

```diff
- <script src="https://accounts.google.com/gsi/client" async defer></script>
+ <script src="https://id.littlexlittle.org/sdk.js" async defer></script>

- <div id="g_id_onload"
-      data-client_id="GOOGLE_CLIENT_ID"
-      data-callback="handleCredentialResponse"></div>
+ <div data-lxl-id="LXL_CLIENT_ID"
+      data-callback="handleCredentialResponse"></div>

- <div class="g_id_signin" data-type="standard"></div>
+ <div data-lxl-id-button data-type="standard"></div>
```

## API equivalence table

| Google | Little X Little |
|---|---|
| `google.accounts.id.initialize(...)` | `lxl.accounts.id.initialize(...)` |
| `google.accounts.id.prompt(cb)` | `lxl.accounts.id.prompt(cb)` |
| `google.accounts.id.renderButton(el, opts)` | `lxl.accounts.id.renderButton(el, opts)` |
| `google.accounts.id.disableAutoSelect()` | `lxl.accounts.id.disableAutoSelect()` |
| `google.accounts.id.cancel()` | `lxl.accounts.id.cancel()` |
| `google.accounts.id.revoke(hint, done)` | `lxl.accounts.id.revoke(hint, done)` |
| `google.accounts.oauth2.initCodeClient(...)` | `lxl.accounts.oauth2.initCodeClient(...)` |
| `google.accounts.oauth2.initTokenClient(...)` | `lxl.accounts.oauth2.initTokenClient(...)` |

## Server-side verification

=== "Before (Google, PHP)"

    ```php
    $client = new Google_Client(['client_id' => GOOGLE_CLIENT_ID]);
    $payload = $client->verifyIdToken($_POST['credential']);
    ```

=== "After (LXL, PHP)"

    ```php
    $client = new LXL\Id\Client(['client_id' => LXL_CLIENT_ID]);
    $payload = $client->verifyOneTap($_POST['credential']);
    ```

The returned `$payload` array shape is the same standard OIDC claim set (`sub`, `email`, `email_verified`, `name`, `picture`, `iss`, `aud`, `iat`, `exp`, `nonce`).

## Things that are different

- **No Google Workspace HD claim.** We add `lxl.app` (NGO code) and `lxl.access` (permission strings) instead.
- **Issuer is `https://id.littlexlittle.org`** — verify against this, not `accounts.google.com`.
- **JWKS URL** is `https://id.littlexlittle.org/.well-known/jwks.json`. Most libraries accept the discovery URL and find JWKS automatically.
- **No FedCM `idAssertionEndpoint`** quirks — we implement it per spec.

## Run both side-by-side

If you want to support both Google and LXL during a transition:

```html
<script src="https://accounts.google.com/gsi/client" async defer></script>
<script src="https://id.littlexlittle.org/sdk.js" async defer></script>

<div id="g_id_onload" data-client_id="..." data-callback="onGoogle"></div>
<div data-lxl-id="..." data-callback="onLxl"></div>
```

The two SDKs do not collide — they live under separate global namespaces and use separate iframe origins.
