Sign In/Out
These are the functions you would use in your dApp to interact with Ramper. Import each from @ramper/ethereum
Sign in
const signIn: (clientAPIKey?: string) => Promise<SignInResult>The sign in options such as which SSO providers to allow and which Web3 wallets to allow can be customized through the init function. It is recommend to call this function when the user clicks the Sign In Button on your web app.
The clientAPIKey is optional. You can obtain it from Ramper Developer Console (coming soon)
Sign out
const signOut: () => Promise<void>Response Types
type SignInResult = {
method: 'ramper' | 'wallet' | 'none'
user?: User
apiGatingToken?: string
}The method value is 'ramper' if the user logged in using SSO or email and a Ramper managed wallet is created for them. The method value is 'wallet' if the user used a Web3 wallet such as Metamask to log in. Lastly, the method returns 'none' if the user cancels the log in process.
The user value contains information regarding the user that logged in. The apiGatingToken is generated based on the clientAPIKey if that value was provided on signIn. The apiGatingToken is an JWT idToken that can be decoded with the clientAPIKey. This key can be used to verify that the user has logged in properly.
Example Response:
{
"method":"ramper",
"user":{
"signupSource":"google.com",
"UID":"iskWbvugB0RVsTt70jC7WguEdM02",
"wallets":{
"ethereum":{
"publicKey":"0x2C682335C7E82364790004B8f37F712A18e2b80A",
"creationDate":1653006881447,
"walletId":"ethereum_0x2C682335C7E82364790004B8f37F712A18e2b80A",
"blockchain":"ethereum"
}
}
}
}Related Data Types:
These are the functions you would use in your dApp to interact with Ramper. Import each from @ramper/near
Sign in
The sign in options such as which SSO providers to allow and which Web3 wallets to allow can be customized through the init function. It is recommend to call this function when the user clicks the Sign In Button on your web app.
The clientAPIKey is optional. You can obtain it from Ramper Developer Console (coming soon)
Sign out
Response Types
The method value is 'ramper' if the user logged in using SSO or email and a Ramper managed wallet is created for them. The method value is 'wallet' if the user used a Web3 wallet such as Near Wallet to log in. Lastly, the method returns 'none' if the user cancels the log in process.
The user value contains information regarding the user that logged in. The apiGatingToken is generated based on the clientAPIKey if that value was provided on signIn. The apiGatingToken is an JWT idToken that can be decoded with the clientAPIKey. This key can be used to verify that the user has logged in properly.
Example Response:
Related Data Types:
These are the functions you would use in your dApp to interact with Ramper. Import each from @ramper/terra
Sign in
The sign in options such as which SSO providers to allow and which Web3 wallets to allow can be customized through the init function. It is recommend to call this function when the user clicks the Sign In Button on your web app.
The walletToUse is the terra wallet provider wallet. The walletToUse is required to support Terra Station and WalletConnect. You can obtain the walletToUse with the following code:
The clientAPIKey is optional. You can obtain it from Ramper Developer Console (coming soon)
Sign out
Response Types
The method value is 'ramper' if the user logged in using SSO or email and a Ramper managed wallet is created for them. The method value is 'wallet' if the user used a Web3 wallet such as Terra Station to log in. Lastly, the method returns 'none' if the user cancels the log in process.
The user value contains information regarding the user that logged in. The apiGatingToken is generated based on the clientAPIKey if that value was provided on signIn. The apiGatingToken is an JWT idToken that can be decoded with the clientAPIKey. This key can be used to verify that the user has logged in properly.
Example Response:
Related Data Types:
Last updated