Methods
Methods can be used after initialization of Wepin Provider SDK.
login
The login variable is a Wepin login library that includes various authentication methods, allowing users to log in using different approaches. It supports email and password login, OAuth provider login, login using ID tokens or access tokens, and more.
Available Methods
loginWithOauthProvidersignUpWithEmailAndPasswordloginWithEmailAndPasswordloginWithIdTokenloginWithAccessTokengetRefreshFirebaseTokenloginWepingetCurrentWepinUserlogoutgetSignForLogin
These methods support various login scenarios, allowing you to select the appropriate method based on your needs.
Example
// Login using an OAuth provider
const oauthResult = await wepinProvider.login.loginWithOauthProvider({
provider: 'google',
clientId: 'your-client-id',
});
// Sign up and log in using email and password
const signUpResult = await wepinProvider.login.signUpWithEmailAndPassword(
'[email protected]',
'password123'
);
// Log in to Wepin
const wepinLoginResult = await wepinProvider.login.loginWepin(signUpResult);
// Get the currently logged-in user
const currentUser = await wepinProvider.login.getCurrentWepinUser();
// Logout
await wepinProvider.login.logout();getProvider
It returns a Provider by given network.
Parameters
network<string> - Available chains Wepin helps provide. It should be lowercase. (e.g., "ethereum", "klaytn", "kaia")
Return value
Promise<BaseProvider> - A EIP-1193 compatible provider
Example
finalize
The finalize() method finalizes the Wepin Provider SDK.
Parameters
None
Return value
Promise<void>
Example
Last updated
Was this helpful?