Trusted adult preferences
Trusted adults can configure preferences for how they want to manage consent and permissions for their children. These preferences are configured in Family Connect and affect how consent challenges are presented and processed.
How preferences work with the API
Trusted adult preferences are part of the session object and are accessible through the /session/get endpoint. Preferences are stored in an allowances array within the session response.
Accessing allowances in sessions
When you retrieve a session by using /session/get, the response includes an allowances array that contains the trusted adult preferences configured for that player. Each allowance represents a preference setting that the trusted adult has configured.
Example session response with allowances
{
"session": {
"sessionId": "b1a6482d-5242-4b4a-aa88-3fa52595a672",
"kuid": "12b9fa0e-6d6d-4903-a1fc-f2233027b71d",
"ageStatus": "LEGAL_ADULT",
"ageCategory": "adult",
"etag": "e889efb9e8a985308e82bed78c5aef7f37f50cf36b7337bf654980d0bab7a574",
"status": "ACTIVE",
"dateOfBirth": "2005-04-15",
"jurisdiction": "US-CA",
"managedBy": "PLAYER",
"permissions": [
{
"name": "text-chat-public",
"enabled": false,
"managedBy": "GUARDIAN"
},
{
"name": "text-chat-private",
"enabled": true,
"managedBy": "PLAYER"
},
{
"name": "forums",
"enabled": false,
"managedBy": "PROHIBITED"
}
],
"allowances": [
{
"name": "3516-7b2e",
"numericalValue": 5,
"type": "numerical"
},
{
"name": "63d3-90ac",
"selectionValue": "733c-ca11",
"type": "selection"
}
]
},
"status": "PASS"
}
Allowance structure
Each allowance in the allowances array has the following structure:
| Field | Type | Description |
|---|---|---|
name | string | A unique identifier for the allowance preference (configured in Compliance Studio) |
type | string | The type of allowance: "numerical" or "selection" |
numericalValue | number | The numerical value (only present when type is "numerical") |
selectionValue | string | The selected value identifier (only present when type is "selection") |
Allowance types
Numerical allowances
Numerical allowances represent preferences that have a numeric value, such as:
- Maximum daily playtime hours
- Maximum spending limits
- Time-based restrictions
Example:
{
"name": "3516-7b2e",
"numericalValue": 5,
"type": "numerical"
}
Selection allowances
Selection allowances represent preferences where the trusted adult has chosen from predefined options, such as:
- Content rating preferences
- Communication settings
- Feature access levels
Example:
{
"name": "63d3-90ac",
"selectionValue": "733c-ca11",
"type": "selection"
}
Using allowances in your application
You can use allowances to implement game logic that respects trusted adult preferences:
- Retrieve the session: Call
/session/getto get the current session with allowances - Check for allowances: Look for the
allowancesarray in the session response - Process each allowance: Iterate through allowances and apply the preference values to your game logic
- Handle allowance types: Check the
typefield to determine whether to usenumericalValueorselectionValue
Example implementation
async function getPlayerAllowances(sessionId) {
const response = await fetch(`/api/v1/session/get?sessionId=${sessionId}`, {
headers: {
'Authorization': `Bearer ${apiKey}`
}
});
const data = await response.json();
const allowances = data.session?.allowances || [];
// Process allowances
const preferences = {};
allowances.forEach(allowance => {
if (allowance.type === 'numerical') {
preferences[allowance.name] = allowance.numericalValue;
} else if (allowance.type === 'selection') {
preferences[allowance.name] = allowance.selectionValue;
}
});
return preferences;
}
When allowances are applied
Allowances are automatically included in the session when:
- A consent challenge is created and approved
- A session is created or updated
- Permissions are upgraded
The allowances reflect the preferences that the trusted adult has configured in Family Connect for that player.
Configuring allowances
Allowances are configured in the Compliance Studio where you define:
- The allowance names (identifiers)
- The allowance types (numerical or selection)
- The available options for selection-type allowances
For detailed information about trusted adult preferences, including how they're configured and how they affect your integration, see Trusted Adult Preferences in the Core concepts section.