@collectivtech/alana-sdk-js / resources/account / UserAccountProfile
Class: UserAccountProfile
Defined in: src/resources/account.ts:356
The profile for the active user. This resource always applies to the user who is currently logged in, with credentials stored in the resource's context.
This is a subclass of the basic User resource that adds data which is only visible to the user himself. For example, the user can see his own settings.
Extends
Constructors
Constructor
new UserAccountProfile(
apiResponse,context):UserAccountProfile
Defined in: src/resources/account.ts:372
Create a new user profile resource for the active user.
Parameters
apiResponse
any
An API response
context
The resource's API context
Returns
UserAccountProfile
Overrides
Properties
_context
protected_context:ApiContext
Defined in: src/resource.ts:148
The API context for this resource.
Inherited from
address?
optionaladdress?:string
Defined in: src/resources/user.ts:72
The street part of the user's address.
Inherited from
address2?
optionaladdress2?:string
Defined in: src/resources/user.ts:77
Any additional "line 2" address data, such as an apartment number or suite.
Inherited from
avatarUrl?
optionalavatarUrl?:string
Defined in: src/resources/user.ts:62
If the user has uploaded an avatar image, this is an absolute link to it. ALANA Platform uploads are stored securely on our servers and made available through the API.
Inherited from
city?
optionalcity?:string
Defined in: src/resources/user.ts:82
The city part of the user's address.
Inherited from
coins?
optionalcoins?:CoinBalance[]
Defined in: src/resources/user.ts:196
A list of all ALANA Coins this user currently holds. ALANA Coins are stores of value in the platform that also include a digital ownership component.
Inherited from
communicationsConsent
communicationsConsent:
UserCommunicationsConsent
Defined in: src/resources/user.ts:231
The user's communications consent settings.
- call - Whether the user has opted into communications via voice call
- text - Whether the user has opted into communications via text message (SMS)
Inherited from
created
created:
Date
Defined in: src/resources/user.ts:223
The timestamp (in UTC) when this user's account was created.
Inherited from
creditContracts?
optionalcreditContracts?:CreditContract[]
Defined in: src/resources/user.ts:204
A list of all ALANA Credit Contracts this user currently holds. Contracts are "stored" Credits or Coins that can potentially earn dividends in the form of ALANA Rewards, but cannot be exchanged for Rewards or cash until a certain maturity date.
Inherited from
credits?
optionalcredits?:CreditBalance[]
Defined in: src/resources/user.ts:189
A list of all ALANA Platform Credits this user currently holds. Credits are non-owning stores of value which can be redeemed for ALANA Rewards or goods and services offered on the platform.
Inherited from
dateOfBirth?
optionaldateOfBirth?:Date
Defined in: src/resources/user.ts:176
The user's date of birth. This is required information upon account creation, as members of the ALANA Platform must be at least 14 years old, due to various state restrictions and regulations.
Inherited from
email
email:
string
Defined in: src/resources/user.ts:45
The email address of the user. The ALANA Platform allows logging in by using the email address instead of a username.
Inherited from
firstName?
optionalfirstName?:string
Defined in: src/resources/user.ts:50
The user's first name.
Inherited from
id
id:
string
Defined in: src/resources/user.ts:39
The user's account ID.
Inherited from
lastName?
optionallastName?:string
Defined in: src/resources/user.ts:55
The user's last name.
Inherited from
pausedSubscriptions?
optionalpausedSubscriptions?:ProfilePausedSubscription[]
Defined in: src/resources/user.ts:218
The user's subscriptions that are currently paused. These are stored separately from "active" subscriptions, because they do not count towards determining whether the user is an active member.
Inherited from
phone?
optionalphone?:string
Defined in: src/resources/user.ts:67
The user's phone number.
Inherited from
postalCode?
optionalpostalCode?:string
Defined in: src/resources/user.ts:94
The ZIP or postal code of the user's address. NOTE: The ALANA Platform is currently US-only.
Inherited from
public?
optionalpublic?:boolean
Defined in: src/resources/user.ts:101
Whether the user has a public profile. Public visibility is opt-in, and allows other users to view abbreviated profile information on another user.
Inherited from
rewardsBalance?
optionalrewardsBalance?:number
Defined in: src/resources/user.ts:182
The user's current number of ALANA Rewards. ALANA Rewards are the base unit of exchange on the ALANA Platform.
Inherited from
state?
optionalstate?:string
Defined in: src/resources/user.ts:88
The state part of the user's address. NOTE: The ALANA Platform is currently US-only.
Inherited from
subscriptionPlans?
optionalsubscriptionPlans?:ProfileSubscription[]
Defined in: src/resources/user.ts:211
The user's subscriptions to sites or brands on the ALANA Platform. A user must have at least one subscription to be considered a member of the Platform.
Inherited from
userOptions?
optionaluserOptions?: [any]
Defined in: src/resources/account.ts:364
Unstructured metadata pertaining to the user's profile. This is mostly opaque, but can be used to store site-specific data under the condition that an application MUST ensure that any existing user options it does not understand are preserved across all uses of the SDK or API calls.
Methods
addresses()
addresses():
Promise<UserAddress[]>
Defined in: src/resources/account.ts:489
Get a list of the active user's saved physical addresses.
Returns
Promise<UserAddress[]>
An array of Address resources
contracts()
contracts():
Promise<CoinContract[]>
Defined in: src/resources/account.ts:452
Get the active user's ALANA Coin contracts. Coin contracts are quantities of ALANA Coins which are "locked" for a period of time. While they are locked, they cannot be spent or transferred, but they have the potential to earn dividends, in the form of ALANA Rewards during the lock period.
Returns
Promise<CoinContract[]>
An array of ALANA Coin contracts
createAddress()
createAddress(
data):Promise<UserAddress>
Defined in: src/resources/account.ts:509
Add a new physical address for the active user. This makes the address available for shipping, transportation, and other features of the Alana Platform.
Parameters
data
The address data
Returns
Promise<UserAddress>
A new Address resource object
follow()
follow():
Promise<MinimalUser>
Defined in: src/resources/user.ts:131
As the active user, follow this user. If this user was not already bbeing followed, this action has no effect.
Returns
Promise<MinimalUser>
A minimal user instance representing the followed user
Inherited from
transferCoins()
transferCoins(
options):Promise<boolean>
Defined in: src/resources/account.ts:425
Request a transfer of ALANA Coins from the active user to another user, identified by email address.
If the contract option is set to true, this operation will use Coins that are in "locked" contracts rather than in the active user's Coin pool.
Parameters
options
The options for the Coin transfer request
Returns
Promise<boolean>
true if the operation succeeded
unfollow()
unfollow():
Promise<MinimalUser>
Defined in: src/resources/user.ts:151
As the active user, unfollow this user. If this user was not already bbeing followed, this action has no effect.
Returns
Promise<MinimalUser>
A minimal user instance representing the unfollowed user
Inherited from
update()
update():
Promise<UserAccountProfile>
Defined in: src/resources/account.ts:385
Update the active user's profile. This uses the values in the current resource, including name, address, phone number, date of birth, profile visibility, and communications preferences.
Returns
Promise<UserAccountProfile>
The updated user profile resource object