@makefully/adaptfully 5.0.0 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/README.md +23 -1
- package/lib/runtime/auth/google-auth.js +16 -3
- package/lib/runtime/auth/social-auth.js +4 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project are documented in this file.
|
|
4
4
|
|
|
5
|
+
## 5.0.1 — 2026-09-17
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- **`google-auth`** requires `config.googleClientId` (no built-in Entanglement client id default).
|
|
10
|
+
- **`social-auth`** no longer falls back to `config.googleClientId` for Capgo `webClientId` — use `platforms.<name>.socialLogin.google.webClientId` only.
|
|
11
|
+
- Docs: browser GIS vs Capacitor Google client ids are documented as separate fan-out surfaces.
|
|
12
|
+
|
|
5
13
|
## 5.0.0 — 2026-09-11
|
|
6
14
|
|
|
7
15
|
### Changed
|
package/README.md
CHANGED
|
@@ -136,7 +136,7 @@ Games should call `adaptfully.has('analytics')` before `get` during rollout if o
|
|
|
136
136
|
|
|
137
137
|
| Plugin key | Registration | Runtime |
|
|
138
138
|
|------------|--------------|---------|
|
|
139
|
-
| `google-auth` | `adaptfully.register('auth', adaptfully.auth.Google)` | Web
|
|
139
|
+
| `google-auth` | `adaptfully.register('auth', adaptfully.auth.Google)` | Web (Google Identity Services) |
|
|
140
140
|
| `steam-auth` | `adaptfully.register('auth', adaptfully.auth.Steam)` | Steam / Electron (via [steamworks.js](https://github.com/ceifa/steamworks.js)) |
|
|
141
141
|
| `social-auth` | `adaptfully.register('auth', adaptfully.auth.Social)` | Capacitor (via [@capgo/capacitor-social-login](https://github.com/Cap-go/capacitor-social-login)) |
|
|
142
142
|
| `dev-auth` | `adaptfully.register('auth', adaptfully.auth.Dev)` | Local / testing |
|
|
@@ -188,6 +188,13 @@ Android/iOS Wrapfully builds use the **`capacitor`** builder family. Cordova/Pho
|
|
|
188
188
|
|
|
189
189
|
**`social-auth` requires `packager: "capacitor"`** and `platforms.<name>.socialLogin` (Capgo provider client IDs). Wrapfully installs `@capgo/capacitor-social-login` when building.
|
|
190
190
|
|
|
191
|
+
Google client IDs are **not** interchangeable across plugins:
|
|
192
|
+
|
|
193
|
+
| Surface | Config | Notes |
|
|
194
|
+
|---------|--------|--------|
|
|
195
|
+
| Browser GIS (`google-auth`) | `config.googleClientId` (via your config registration / bridge) | OAuth **Web** client whose authorized JavaScript origins include the site origin |
|
|
196
|
+
| Capacitor Capgo (`social-auth`) | `platforms.<name>.socialLogin.google.webClientId` | Server / web client id for native Google Sign-In — do **not** put this in `googleClientId` |
|
|
197
|
+
|
|
191
198
|
```json
|
|
192
199
|
{
|
|
193
200
|
"config": {
|
|
@@ -220,6 +227,19 @@ Android/iOS Wrapfully builds use the **`capacitor`** builder family. Cordova/Pho
|
|
|
220
227
|
}
|
|
221
228
|
```
|
|
222
229
|
|
|
230
|
+
#### Google auth (`google-auth`)
|
|
231
|
+
|
|
232
|
+
Browser-only plugin using [Google Identity Services](https://developers.google.com/identity/oauth2/web/guides/overview) (`accounts.google.com/gsi/client`). Requires `config.googleClientId` — there is no built-in default. GIS authorized origins are **per OAuth client**; reusing `socialLogin.google.webClientId` here is a common failure mode when mobile and web need different clients.
|
|
233
|
+
|
|
234
|
+
Optional config keys:
|
|
235
|
+
|
|
236
|
+
| Key | Default | Purpose |
|
|
237
|
+
|-----|---------|---------|
|
|
238
|
+
| `googleClientId` | *(required)* | Browser GIS OAuth client id |
|
|
239
|
+
| `googleTokenKey` | `adaptfully_google_token` | `sessionStorage` key for the access token |
|
|
240
|
+
| `googleScopes` | `openid email profile` | OAuth scopes |
|
|
241
|
+
| `autoLoginStorageKey` | `lastLoggedIn` | Storage key written with the user id on login |
|
|
242
|
+
|
|
223
243
|
#### Steam auth (`steam-auth`)
|
|
224
244
|
|
|
225
245
|
When `steam-auth` is registered on an **`electron`** platform, Adaptfully prebuild writes:
|
|
@@ -242,6 +262,8 @@ The runtime plugin calls Capgo `SocialLogin.initialize` / `login` / `logout` / `
|
|
|
242
262
|
|
|
243
263
|
**Apple-only iOS** (`providers.google: false`, `providers.apple: true`) is supported — Google `webClientId` is not required. On iOS, if `apple.clientId` is omitted, Adaptfully defaults it to the platform `packageName` (Capgo uses this as a plugin label on native iOS, not an Apple Services ID). On Android, Apple Sign-In still requires `apple.clientId`. At runtime, an empty Apple `clientId` also falls back to `window.gameConfig.packageName`.
|
|
244
264
|
|
|
265
|
+
Google Sign-In on Capacitor reads **`socialLogin.google.webClientId` only** (via `social-login-config.js`). It does not fall back to `config.googleClientId`.
|
|
266
|
+
|
|
245
267
|
Optional config keys:
|
|
246
268
|
|
|
247
269
|
| Key | Default | Purpose |
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
(function registerGoogleAuth(ns) {
|
|
4
4
|
const { configValue, getStorage } = ns.auth.helpers;
|
|
5
5
|
|
|
6
|
-
const DEFAULT_CLIENT_ID = '225754014403.apps.googleusercontent.com';
|
|
7
6
|
const DEFAULT_SCOPES = 'openid email profile';
|
|
8
7
|
const DEFAULT_TOKEN_KEY = 'adaptfully_google_token';
|
|
9
8
|
const DEFAULT_AUTO_LOGIN_KEY = 'lastLoggedIn';
|
|
@@ -33,8 +32,13 @@
|
|
|
33
32
|
return configValue('googleTokenKey', DEFAULT_TOKEN_KEY);
|
|
34
33
|
}
|
|
35
34
|
|
|
35
|
+
/**
|
|
36
|
+
* Browser GIS OAuth client id only (`config.googleClientId`).
|
|
37
|
+
* Capacitor / Capgo builds use `platforms.<name>.socialLogin.google.webClientId` instead.
|
|
38
|
+
*/
|
|
36
39
|
#clientId() {
|
|
37
|
-
|
|
40
|
+
const clientId = configValue('googleClientId', '');
|
|
41
|
+
return typeof clientId === 'string' ? clientId.trim() : '';
|
|
38
42
|
}
|
|
39
43
|
|
|
40
44
|
#scopes() {
|
|
@@ -47,8 +51,17 @@
|
|
|
47
51
|
|
|
48
52
|
whenReady(done) {
|
|
49
53
|
const setup = () => {
|
|
54
|
+
const clientId = this.#clientId();
|
|
55
|
+
if (!clientId) {
|
|
56
|
+
console.error(
|
|
57
|
+
'google-auth: config.googleClientId is required '
|
|
58
|
+
+ '(browser GIS OAuth client; do not reuse socialLogin.google.webClientId).',
|
|
59
|
+
);
|
|
60
|
+
done({ error: 'google-auth: config.googleClientId is required' });
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
50
63
|
this.tokenClient = google.accounts.oauth2.initTokenClient({
|
|
51
|
-
client_id:
|
|
64
|
+
client_id: clientId,
|
|
52
65
|
scope: this.#scopes(),
|
|
53
66
|
callback: () => {},
|
|
54
67
|
});
|
|
@@ -107,9 +107,11 @@
|
|
|
107
107
|
const options = {};
|
|
108
108
|
|
|
109
109
|
if (config.providers?.google !== false) {
|
|
110
|
+
// Capgo webClientId comes only from platforms.<name>.socialLogin
|
|
111
|
+
// (written to __ADAPTFULLY_SOCIAL_LOGIN__). Do not fall back to
|
|
112
|
+
// config.googleClientId — that key is for browser google-auth / GIS.
|
|
110
113
|
options.google = {
|
|
111
|
-
webClientId: config.google?.webClientId
|
|
112
|
-
|| configValue('googleClientId', ''),
|
|
114
|
+
webClientId: config.google?.webClientId || '',
|
|
113
115
|
iOSClientId: config.google?.iOSClientId,
|
|
114
116
|
iOSServerClientId: config.google?.iOSServerClientId
|
|
115
117
|
|| config.google?.webClientId,
|