Installation

Installing with a Package Manager

It can be installed as an npm package.

npm install @wepin/pin-js

Once the installation is complete, initialize the WepinLogin instance using the app ID and app key assigned after registering the app. This will enable the use of WepinPin.

// 1. Import the package
import { WepinPin } from '@wepin/pin-js'

// 2. Initialization
const wepinPin = new WepinPin({
  appKey: 'your-wepin-app-key',
})

This package is designed to work only in Client Side Rendering (CSR) environments. If you are using this package in a Server Side Rendering (SSR) environment, you need to configure it so that the package is loaded only on the client side.

Refer to the following code for implementation:

const initWepinPin = async () => {
   const { WepinPin } = await import('@wepin/pin-js');
   const wepinPin = new WepinPin({
       appKey: '',
   });
   await wepinPin.init();
}

Last updated