
Security News
/Company News
Securing the Financial Frontier: How Capital One Uses Socket for Open Source Security
Capital One is partnering with Socket to proactively secure its open source supply chain.
@capgo/capacitor-age-range
Advanced tools
Cross-platform age range detection. Google Play Age Signals on Android, Apple DeclaredAgeRange on iOS.
Cross-platform age range detection for Capacitor apps. Uses Google Play Age Signals on Android and Apple DeclaredAgeRange on iOS.
A unified, free, and lightweight age range plugin:
The most complete doc is available here: https://capgo.app/docs/plugins/age-range/
| Plugin version | Capacitor compatibility | Maintained |
|---|---|---|
| v8.*.* | v8.*.* | ✅ |
| v7.*.* | v7.*.* | On demand |
| v6.*.* | v6.*.* | ❌ |
| v5.*.* | v5.*.* | ❌ |
Note: The major version of this plugin follows the major version of Capacitor. Use the version that matches your Capacitor installation (e.g., plugin v8 for Capacitor 8). Only the latest major version is actively maintained.
npm install @capgo/capacitor-age-range
npx cap sync
NOT_AVAILABLE on older versions)Add the com.apple.developer.declared-age-range entitlement to your app:
Or add manually to your *.entitlements file:
<key>com.apple.developer.declared-age-range</key>
<true/>
On iOS, requestAgeRange() presents a system dialog where the user (or their guardian via Family Sharing) declares their age range. The ageGates option controls the age boundaries shown in the dialog (default: [13, 16, 18]).
On Android, the plugin queries Google Play Age Signals API in the background — no user prompt is shown. The Play Store determines the user's age verification status from their Google account.
No additional permissions or manifest changes are needed.
Not supported. The web implementation throws 'AgeRange does not have web implementation'.
Cross-platform age range detection plugin.
Uses Google Play Age Signals on Android and Apple DeclaredAgeRange on iOS.
requestAgeRange(options?: RequestAgeRangeOptions | undefined) => Promise<AgeRangeResult>
Request the user's age range.
On Android: queries Google Play Age Signals API (no user prompt). On iOS: presents the system DeclaredAgeRange dialog (requires iOS 26.2+).
| Param | Type | Description |
|---|---|---|
options | RequestAgeRangeOptions | - Configuration for the age range request |
Returns: Promise<AgeRangeResult>
Since: 8.0.0
getPluginVersion() => Promise<{ version: string; }>
Get the native Capacitor plugin version.
Returns: Promise<{ version: string; }>
Since: 8.0.0
Result of the age range request.
| Prop | Type | Description | Since |
|---|---|---|---|
status | AgeRangeStatus | The outcome status of the age range request. | 8.0.0 |
ageLower | number | Inclusive lower bound of the user's age range. Present when age data is available. | 8.0.0 |
ageUpper | number | Inclusive upper bound of the user's age range. May be absent if the user is in the highest age bracket (e.g. 18+). | 8.0.0 |
declarationSource | DeclarationSource | How the age was declared/determined. On iOS: 'SELF_DECLARED' or 'GUARDIAN_DECLARED'. On Android: 'SUPERVISED' (guardian-managed) or 'VERIFIED' (Google-verified 18+). | 8.0.0 |
androidUserStatus | AndroidUserStatus | Android-only. The user's Google Play verification status. | 8.0.0 |
mostRecentApprovalDate | string | Android-only. Effective date for the most recent guardian-approved change. | 8.0.0 |
installId | string | Android-only. Install identifier for supervised installs in Google Play. | 8.0.0 |
Options for the age range request.
| Prop | Type | Description | Default | Since |
|---|---|---|---|---|
ageGates | number[] | Age thresholds for the request. On iOS: these are passed to requestAgeRange(ageGates:) as the age boundaries presented in the system dialog. Common values: [13, 16, 18]. On Android: this parameter is ignored (Play Age Signals returns predefined ranges: 0-12, 13-15, 16-17, 18+). | [13, 16, 18] | 8.0.0 |
Top-level status of the age range request.
'SHARING' | 'DECLINED_SHARING' | 'NOT_AVAILABLE' | 'ERROR'
How the age range was declared or determined.
'SELF_DECLARED' | 'GUARDIAN_DECLARED' | 'VERIFIED' | 'UNKNOWN'
Android-specific Google Play user status values.
'VERIFIED' | 'SUPERVISED' | 'SUPERVISED_APPROVAL_PENDING' | 'SUPERVISED_APPROVAL_DENIED' | 'UNKNOWN' | 'EMPTY'
import { AgeRange } from '@capgo/capacitor-age-range';
// Request age range with default gates (13, 16, 18)
const result = await AgeRange.requestAgeRange();
switch (result.status) {
case 'SHARING':
console.log('Age range:', result.ageLower, '-', result.ageUpper);
console.log('Source:', result.declarationSource);
break;
case 'DECLINED_SHARING':
console.log('User declined to share age');
break;
case 'NOT_AVAILABLE':
console.log('Age range API not available');
break;
case 'ERROR':
console.log('Error occurred');
break;
}
// Custom age gates (iOS only)
const result2 = await AgeRange.requestAgeRange({ ageGates: [13, 18] });
| Android UserStatus | → status | → declarationSource |
|---|---|---|
| VERIFIED | SHARING | VERIFIED |
| SUPERVISED | SHARING | GUARDIAN_DECLARED |
| SUPERVISED_APPROVAL_PENDING | SHARING | GUARDIAN_DECLARED |
| SUPERVISED_APPROVAL_DENIED | SHARING | GUARDIAN_DECLARED |
| UNKNOWN / EMPTY | DECLINED_SHARING | — |
| iOS Response | → status | → declarationSource |
|---|---|---|
| .sharing (selfDeclared) | SHARING | SELF_DECLARED |
| .sharing (guardianDeclared) | SHARING | GUARDIAN_DECLARED |
| .declinedSharing | DECLINED_SHARING | — |
FAQs
Cross-platform age range detection. Google Play Age Signals on Android, Apple DeclaredAgeRange on iOS.
The npm package @capgo/capacitor-age-range receives a total of 11,577 weekly downloads. As such, @capgo/capacitor-age-range popularity was classified as popular.
We found that @capgo/capacitor-age-range demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.

Security News
/Company News
Capital One is partnering with Socket to proactively secure its open source supply chain.

Security News
Socket CTO Ahmad Nassri discusses how to keep AI agents from bypassing package blocks, limit credential access, and monitor their actions.

Security News
GPT-6 Astra tried to plant malicious code in simulated open source projects using fake GitHub accounts and deceptive PRs during an assigned CTF challenge.