IdentityConfig
Identity SDK configuration
The way the properties map works is that you specify any IdentityProperty overrides for standard properties or a complete IdentityProperty configuration for custom properties.
For a list of standard properties see: IdentityProperty.standardMap.
Static Method Summary
| Static Public Methods | ||
| public static |
Returns Promise of IdentityConfig from specified server and with specified App key |
|
Constructor Summary
| Public Constructor | ||
| public |
constructor(defaultPage: string, redirectUrls: string[], properties: Map<string, Object>, facebook: Map<string, string>, google: Map<string, string>, sessionTimeout: number, userTimeout: number, theme: Object, analytics: Object, zeroBounce: Object) IdentityConfig constructor |
|
Static Public Methods
public static request(): Promise<IdentityConfig, Error> source
Returns Promise of IdentityConfig from specified server and with specified App key
For each NBC App an IdentityConfig should be stored at: https://id.nbc.com/sdk/config/<key>.json Where <key> is the App key, e.g: example => https://id.nbc.com/sdk/config/example.json
For non production environments this URL will change accordingly, e.g. for dev: https://dev-id.nbc.com/sdk/config/example.json
Params:
| Name | Type | Attribute | Description |
| options.server | IdentityServer |
|
IdentityServer to get config from |
| options.key | String |
|
Key of App to get configuration for |
| options.configLocationHost | String |
|
Custom config host url |
Example:
{
"redirectUrls": [
"https://id.nbc.com/sdk/example/"
],
"properties": {
"email": {}, // allow this credential to be used
"firstName": { // extend config to request and require this whenever a user authenticates
"request": true,
"required": true
},
"lastName": { // request (but not require) this whenever a user authenticates
"request": true
},
"sponsorOptIn": { // specify a complete configuration for custom properties (e.g: prefixed by app key)
"label": "I want to get cool stuff from Sponsor",
"type": "boolean",
"required": true,
"default_value": true
}
},
"facebook": {
"appId": "1234", // use a non standard Facebook App
"permissions": ["email", "user_friends"] // besides the usual email, also ask for friends
}
}
Public Constructors
public constructor(defaultPage: string, redirectUrls: string[], properties: Map<string, Object>, facebook: Map<string, string>, google: Map<string, string>, sessionTimeout: number, userTimeout: number, theme: Object, analytics: Object, zeroBounce: Object) source
IdentityConfig constructor
Params:
| Name | Type | Attribute | Description |
| defaultPage | string |
|
The default page to load on init |
| redirectUrls | string[] |
|
White list of redirect URLs to accept |
| properties | Map<string, Object> |
|
Map of user property keys to configurations |
| Map<string, string> |
|
Facebook config |
|
| Map<string, string> |
|
Google config |
|
| sessionTimeout | number |
|
Session token timeout in seconds, default 1 year |
| userTimeout | number |
|
User data cache timeout in seconds, default 1 hour |
| theme | Object |
|
Customizable theme parameters |
| analytics | Object |
|
Analytics settings |
| zeroBounce | Object |
|
ZeroBounce settings |
Manual
Reference
Source
Test
