new AmidoProfileService(config) → {AmidoProfileService}
Instantiate an instance of the profile service SDK
Parameters:
| Name | Type | Description |
|---|---|---|
config |
Properties:
| Name | Type | Description |
|---|---|---|
subscriptionKey |
string |
Returns:
- Type
- AmidoProfileService
Methods
-
createIdentityUser(profile) → {Promise}
-
Create a new user profile with their identity provider, defined by the identityProvider set in the constructor (if provided)
Parameters:
Name Type Description profilethe profile to save
Returns:
- resolved with the profile if successful
- Type
- Promise
-
createProfile(userId, realm, delegateToken, profile) → {Promise}
-
Create a profile for an existing user within the specified realm
Parameters:
Name Type Description userIdthe user's ID
realmthe realm to create the profile
delegateTokenthe user's access token to authorize with the API
profilethe JSON profile to save
Returns:
- resolved with the profile if successful.
- Type
- Promise
-
getFieldsets(realm, screenName) → {Promise}
-
Get the schema for a given field set
Parameters:
Name Type Description realmstring screenNamestring name of fieldset to load
Returns:
- Resolved with the fieldset
- Type
- Promise
-
getNestedProfile(userId, realm, delegateToken) → {Promise}
-
Return a user's nested profile. If a user's profile has a parent profile, will also be returned.
Parameters:
Name Type Description userIdthe user's ID
realmthe realm to create the profile
delegateTokenthe user's access token to authorize with the API
Returns:
- resolved with the user's nested profile
- Type
- Promise
-
getProfile(userId, realm, delegateToken) → {Promise}
-
Get a user's profile for a specific schema
Parameters:
Name Type Description userIdthe user's ID
realmthe realm to create the profile
delegateTokenthe user's access token to authorize with the API
Returns:
- resolved with the user's profile
- Type
- Promise
-
updateIdentityUser(userId, profile) → {Promise}
-
Update a user's profile for their identity provider, defined by the identityProvider set in the constructor (if provided)
Parameters:
Name Type Description userIdthe user's ID
profilethe profile to update
Returns:
- resolved with the profile if successful
- Type
- Promise
-
updateProfile(userId, realm, delegateToken, profile) → {Promise}
-
Update the profile of an existing user within the specified realm
Parameters:
Name Type Description userIdthe user's ID
realmthe realm to create the profile
delegateTokenthe user's access token to authorize with the API
profilethe JSON profile to save
Returns:
- resolved with the profile if successful.
- Type
- Promise