npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@wepin/pin-rn

v1.2.1

Published

Wepin React Native SDK Library for Android/iOS

Readme

@wepin/pin-rn

mit licence

npm version npm downloads

platform - android platform - ios

Wepin PIN Pad SDK for React Native. This package is exclusively available for use in React Native environments (Android and iOS).

⏩ Get App ID and Key

After signing up for Wepin Workspace, go to the development tools menu and enter the information for each app platform to receive your App ID and App Key.

⏩ Requirements

  • Android API version 24 or newer is required.
  • iOS version 13 or newer is required.

⏩ Install

npm install @wepin/pin-rn

or

yarn add @wepin/pin-rn

peerDependencies

npm install react-native-device-info

# for ios
cd ios
pod install

or

yarn add react-native-device-info

# for ios
cd ios
pod install

⏩ Getting Started

To enable OAuth login functionality, you need to configure the Deep Link Scheme.

Deep Link scheme format : wepin. + Your Wepin App ID

Android

When a custom scheme is used, WepinLogin Library can be easily configured to capture all redirects using this custom scheme through a manifest placeholder in the file build.gradle(app):

// For Deep Link => RedirectScheme Format : wepin. + Wepin App ID
android.defaultConfig.manifestPlaceholders = [
  'appAuthRedirectScheme': 'wepin.{{YOUR_WEPIN_APPID}}'
]

iOS

You must add the app's URL scheme to the Info.plist file. This is necessary for redirection back to the app after the authentication process.

The value of the URL scheme should be 'wepin.' + your Wepin app id.

<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLSchemes</key>
        <string>Editor</string>
        <key>CFBundleURLName</key>
        <string>unique name</string>
        <array>
            <string>wepin + your Wepin app id</string>
        </array>
    </dict>
</array>

⏩ Import SDK

import WepinPin from '@wepin/pin-rn';

⏩ Initialize

const wepinPin = new WepinPin({
  appId: 'wepinAppId',
  appKey: 'wepinAppKey',
});

init

await wepinPin.init(attributes);

Parameters

  • attributes <IWepinSDKAttributes> optional
    • defaultLanguage: The language to be displayed on the PIN pad (default: 'en') Currently, only ko, en, and ja are supported.
    • defaultCurrency: The currency to be displayed on the PIN pad (default: 'USD') Currently, only 'KRW','USD' and 'JPY' are supported.

Returns

  • Promise<boolean>

Example

await wepinPin.init({
  defaultLanguage: 'ko',
  defaultCurrency: 'KRW',
});

isInitialized

wepinPin.isInitialized();

The isInitialized() method checks if the Wepin PIN Pad SDK is initialized.

Returns

  • <boolean>
    • true if Wepin PIN Pad SDK is already initialized.

changeLanguage

await wepinPin.changeLanguage({ language });

Changes the language displayed on the PIN pad screen.

Parameters

  • <object>
    • language <string> - The language to be displayed on the PIN pad screen. Currently, only 'ko', 'en' and 'ja' are supported.

Returns

  • Promise<void>

Example

await wepinPin.changeLanguage({ language: 'ko' });

⏩ Method

Methods can be used after initialization of Wepin PIN Pad 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

  • loginWithOauthProvider
  • signUpWithEmailAndPassword
  • loginWithEmailAndPassword
  • loginWithIdToken
  • loginWithAccessToken
  • getRefreshFirebaseToken
  • loginWepin
  • getCurrentWepinUser
  • logout
  • getSignForLogin

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 wepinPin.login.loginWithOauthProvider({
  provider: 'google',
  clientId: 'your-client-id',
});

// Sign up and log in using email and password
const signUpResult = await wepinPin.login.signUpWithEmailAndPassword(
  '[email protected]',
  'password123'
);

// Log in to Wepin
const wepinLoginResult = await wepinPin.login.loginWepin(signUpResult);

// Get the currently logged-in user
const currentUser = await wepinPin.login.getCurrentWepinUser();

// Logout
await wepinPin.login.logout();

generateRegistrationPINBlock

await wepinPin.generateRegistrationPINBlock();

Generates a pin block for registration. This method should only be used when the loginStatus is pinRequired.

Parameters

  • void

Returns

  • Promise<RegistrationPinBlock>
    • uvd <EncUVD> - Encrypted PIN
      • b64Data <string> - Data encrypted with the original key in b64SKey
      • b64SKey <string> - A key that encrypts data encrypted with the Wepin's public key.
      • seqNum <number> optional - Values to check for when using PIN numbers to ensure they are used in order.
    • hint <EncPinHint> - Hints in the encrypted PIN.
      • data <string> - Encrypted hint data.
      • length <string> - The length of the hint
      • version <number> - The version of the hint

Example

const pinBlock = await wepinPin.generateRegistrationPINBlock();

// You need to make a Wepin RESTful API request using the received data.
fetch('https://sdk.wepin.io/v1/app/register', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    // Add authentication headers
  },
  body: JSON.stringify({
    // Add other required fields
    UVD: pinBlock.uvd,
    hint: pinBlock.hint,
  }),
});

generateAuthPINBlock

await wepinPin.generateAuthPINBlock(count?);

Generates a pin block for authentication.

Parameters

  • count <number> optional - If multiple PIN blocks are needed, please enter the number to generate. If the count value is not provided, it will default to 1.

Returns

  • Promise<AuthPinBlock>
    • uvdList <EncUVD[]> - Encrypted pin list
      • b64Data <string> - Data encrypted with the original key in b64SKey
      • b64SKey <string> - A key that encrypts data encrypted with the wepin's public key.
      • seqNum <number> optional - Values to check for when using PIN numbers to ensure they are used in order
    • otp <string> optional - If OTP authentication is required, include the OTP.

Example

const pinBlock = await wepinPin.generateAuthPINBlock(3);

// Sort seqNum of uvd in ascending order from 1 because you need to write it in order starting from 1
pinBlock.uvdList.sort((a, b) => (a.seqNum ?? 0) - (b.seqNum ?? 0));

const resArray = [];
for (const encUVD of pinBlock.uvdList) {
  const response = await fetch('https://sdk.wepin.io/v1/tx/sign', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      // Add authentication headers
    },
    body: JSON.stringify({
      userId: await getUserId(),
      walletId: await getWalletId(),
      accountId: (await getEthereumAccount()).accountId,
      type: 'msg_sign',
      txData: {
        data: '0x0',
      },
      pin: encUVD,
      otpCode: {
        code: pinBlock.otp,
      },
    }),
  });
  resArray.push(response);
}

generateChangePINBlock

await wepinPin.generateChangePINBlock();

Generate pin block for changing the PIN.

Parameters

  • void

Returns

  • Promise<ChangePinBlock>
    • uvd <EncUVD> - The user's existing encrypted PIN
      • b64Data <string> - Data encrypted with the original key in b64SKey
      • b64SKey <string> - A key that encrypts data encrypted with the wepin's public key.
      • seqNum <number> optional - Values to check for when using PIN numbers to ensure they are used in order
    • newUVD <EncUVD> - The user's new encrypted PIN
      • b64Data <string> - Data encrypted with the original key in b64SKey
      • b64SKey <string> - A key that encrypts data encrypted with the wepin's public key.
      • seqNum <number> optional - Values to check for when using PIN numbers to ensure they are used in order
    • hint <EncPinHint> - Hints in the encrypted PIN
      • data <string> - Encrypted hint data
      • length <string> - The length of the hint
      • version <number> - The version of the hint
    • otp <string> optional - If OTP authentication is required, include the OTP.

Example

const pinBlock = await wepinPin.generateChangePINBlock();

const response = await fetch('https://sdk.wepin.io/v1/wallet/pin/change', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    // Add authentication headers
  },
  body: JSON.stringify({
    userId: await getUserId(),
    walletId: await getWalletId(),
    UVD: pinBlock.uvd,
    newUVD: pinBlock.newUVD,
    hint: pinBlock.hint,
    otpCode: {
      code: pinBlock.otp,
    },
  }),
});

generateAuthOTPCode

await wepinPin.generateAuthOTPCode();

Generate OTP for failed verify OTP.

Parameters

  • void

Returns

  • Promise<AuthOTP>
    • code <string> - The OTP entered by the user.

Example

let res = await getWepinSignMessage(pinBlocks.uvdList, pinBlock.otp);
if (res.body[0].message === 'OTP_MISMATCH_WRONG_CODE') {
  const otp = await wepinPin.generateAuthOTPCode();
  res = await getWepinSignMessage(pinBlocks.uvdList, otp.code);
}

finalize

await wepinPin.finalize();

The finalize() method finalizes the Wepin PIN Pad SDK.

Parameters

  • void

Returns

  • Promise<void>

Example

await wepinPin.finalize();

WepinPinError

This section provides descriptions of various error codes that may be encountered while using the Wepin PIN Pad SDK functionalities. Each error code corresponds to a specific issue, and understanding these can help in debugging and handling errors effectively.

| Error Code | Description | | ---------------------------- | ------------------------------------------------------------------------------------------------- | | ApiRequestError | There was an error while making the API request. | | InvalidParameters | One or more parameters provided are invalid or missing. | | NotInitialized | The Wepin PIN Pad SDK has not been properly initialized. | | InvalidAppKey | The Wepin app key is invalid. | | InvalidLoginProvider | The login provider specified is not supported or is invalid. | | InvalidToken | The token does not exist. | | InvalidLoginSession | The login session information does not exist. | | UserCancelled | The user has cancelled the operation. | | UnknownError | An unknown error has occurred, and the cause is not identified. | | NotConnectedInternet | The system is unable to detect an active internet connection. | | FailedLogin | The login attempt has failed due to incorrect credentials or other issues. | | AlreadyLogout | The user is already logged out, so the logout operation cannot be performed again. | | AlreadyInitialized | The Wepin PIN Pad SDK is already initialized. | | InvalidEmailDomain | The provided email address's domain is not allowed or recognized by the system. | | FailedSendEmail | The system encountered an error while sending an email. | | RequiredEmailVerified | Email verification is required to proceed with the requested operation. | | IncorrectEmailForm | The provided email address does not match the expected format. | | IncorrectPasswordForm | The provided password does not meet the required format or criteria. | | NotInitializedNetwork | The network or connection required for the operation has not been properly initialized. | | RequiredSignupEmail | The user needs to sign up with an email address to proceed. | | FailedEmailVerified | The Wepin PIN Pad SDK encountered an issue while attempting to verify the provided email address. | | FailedPasswordStateSetting | Failed to set the password state. | | FailedPasswordSetting | The Wepin PIN Pad SDK failed to set the password. | | ExistedEmail | The provided email address is already registered in Wepin. | | NotActivity | The Context is not an activity. |