Create User Metadata
createEmailAddress()
function createEmailAddress: (params: CreateEmailAddressParams) => Promise<EmailAddress>;
Adds an email address for the user. A new EmailAddress
will be created and associated with the user.
CreateEmailAddressParams
Name | Type | Description |
---|---|---|
email | string | The value of the email address |
Returns
Type | Description |
---|---|
Promise<EmailAddress> | The email address created for the user. |
createPhoneNumber()
function createPhoneNumber: (params: CreatePhoneNumberParams) => Promise<PhoneNumber>;
Adds a phone number for the user. A new PhoneNumber
will be created and associated with the user.
CreatePhoneNumberParams
Name | Type | Description |
---|---|---|
phoneNumber | string | The value of the phone number, in E.164 format. |
Returns
Type | Description |
---|---|
Promise<PhoneNumber> | The phone number created for the user. |
createWeb3Wallet()
function createWeb3Wallet: (params: CreateWeb3WalletParams) => Promise<Web3Wallet>;
Adds a web3 wallet for the user. A new Web3Wallet<
will be created and associated with the user.
CreateWeb3WalletParams
Name | Type | Description |
---|---|---|
web3Wallet | string | In Ethereum, the address is made up of 0x + 40 hexadecimal characters |
Returns
Type | Description |
---|---|
Promise<Web3Wallet> | The web3 wallet created for the user. |
createExternalAccount()
function createExternalAccount: (params: CreateExternalAccountParams) => Promise<ExternalAccount>;
Adds an external account for the user. A new ExternalAccount
will be created and associated with the user.
CreateExternalAccountParams
Name | Type | Description |
---|---|---|
strategy | OAuthStrategy | The strategy corresponding to the oauth provider, e.g. oauth_facebook , oauth_github , etc |
redirectUrl? | string | The URL to redirect back to one the oauth flow has completed successfully or unsuccessfully. |
additionalScopes? | string[] | Any additional scopes you would like your user to be prompted to approve. |
Returns
Type | Description |
---|---|
Promise<ExternalAccount> | The external account created for the user. |
The initial state
of the returned ExternalAccount
will be unverified
. To initiate the connection with the external provider one should redirect to the externalAccount.verification.externalVerificationRedirectURL
contained in the result of createExternalAccount
.
Upon return, one can inspect within the user.externalAccounts
the entry that corresponds to the requested strategy:
- If the connection was successful then
externalAccount.verification.status
should beverified
- If the connection was not successful, then the
externalAccount.verification.status
will not beverified
and theexternalAccount.verification.error
will contain the error encountered so that you can present corresponding feedback to the user