@capgo/capacitor-android-age-signals
v8.1.3
Published
Capacitor plugin that exposes Google Play Age Signals to your app.
Maintainers
Readme
@capgo/capacitor-android-age-signals
Capacitor wrapper for the Google Play Age Signals API. Detect supervised accounts, guardian approvals, and verified users directly from your app (Android only). Compatible with Capacitor 8/7
Why Android Age Signals?
The only free Capacitor plugin for Google Play's Age Signals API. Implement COPPA and teen safety compliance with:
- Supervised account detection - Identify users with parental controls
- Age verification - Detect 18+ verified users
- Guardian approval tracking - Monitor pending approvals and denials
- Compliant features - Build age-appropriate experiences and comply with regulations
- Same JavaScript API - Compatible interface with paid alternatives
Critical for apps targeting families, children, and teens who need age-gate functionality.
Documentation
Authoritative docs live inside this repo for now. Explore the TypeScript definitions in src/definitions.ts and the Android implementation under android/ for platform behavior. Run the included example app for an end-to-end walkthrough.
Install
npm install @capgo/capacitor-android-age-signals
npx cap sync androidGoogle Play Age Signals is available only on Android phones with the Play Store installed.
Usage
import { AgeSignals } from '@capgo/capacitor-android-age-signals';
import { UserStatus } from '@capgo/capacitor-android-age-signals';
const result = await AgeSignals.checkAgeSignals();
if (result.userStatus === UserStatus.Supervised) {
console.info(`Supervised user aged between ${result.ageLower} and ${result.ageUpper}`);
} else if (result.userStatus === UserStatus.Verified) {
console.info('User is 18+ and verified by Google.');
} else {
console.warn('No definitive age signal returned.');
}API
Capacitor interface for retrieving Play Age Signals.
checkAgeSignals()
checkAgeSignals() => Promise<CheckAgeSignalsResult>Request the current Play Age Signals for the active user.
Only available on Android devices with Google Play installed.
Returns: Promise<CheckAgeSignalsResult>
Since: 0.0.1
getPluginVersion()
getPluginVersion() => Promise<{ version: string; }>Get the native Capacitor plugin version.
Returns: Promise<{ version: string; }>
Since: 1.0.0
Interfaces
CheckAgeSignalsResult
Structured result returned by {@link AgeSignalsPlugin.checkAgeSignals}.
| Prop | Type | Description | Since |
| ---------------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----- |
| userStatus | UserStatus | The user's verification status as reported by Google Play. | 0.0.1 |
| ageLower | number | Inclusive lower bound of the supervised user's age range. Present only when userStatus is SUPERVISED, SUPERVISED_APPROVAL_PENDING, or SUPERVISED_APPROVAL_DENIED. | 0.0.1 |
| ageUpper | number | Inclusive upper bound of the supervised user's age range. Present only when userStatus is SUPERVISED, SUPERVISED_APPROVAL_PENDING, or SUPERVISED_APPROVAL_DENIED and the user's age is reported as less than 18. | 0.0.1 |
| mostRecentApprovalDate | string | Effective date for the most recent significant change that received guardian approval. Present only when userStatus is SUPERVISED_APPROVAL_PENDING or SUPERVISED_APPROVAL_DENIED. | 0.0.1 |
| installId | string | Identifier assigned to supervised installs in Google Play for revocation notifications. Present only when userStatus is SUPERVISED, SUPERVISED_APPROVAL_PENDING, or SUPERVISED_APPROVAL_DENIED. | 0.0.1 |
Enums
UserStatus
| Members | Value | Description | Since |
| ------------------------------- | ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
| Verified | 'VERIFIED' | The user is over 18 and their age has been verified by Google. | 0.0.1 |
| Supervised | 'SUPERVISED' | The user has a supervised Google Account managed by a guardian. Use ageLower and ageUpper to determine the user's age range. | 0.0.1 |
| SupervisedApprovalPending | 'SUPERVISED_APPROVAL_PENDING' | The supervised user has pending significant changes awaiting guardian approval. Use ageLower and ageUpper to determine the user's age range and mostRecentApprovalDate to identify the most recent approved change. | 0.0.1 |
| SupervisedApprovalDenied | 'SUPERVISED_APPROVAL_DENIED' | The supervised user's guardian denied one or more significant changes. Use ageLower and ageUpper to determine the user's age range and mostRecentApprovalDate to identify the last approved change. | 0.0.1 |
| Unknown | 'UNKNOWN' | The user is not verified or supervised in supported regions. You should prompt the user to resolve their status in the Play Store. | 0.0.1 |
| Empty | 'EMPTY' | All other users return this value. | 0.0.1 |
