Initialization
Here is how to initialize the Wepin Widget JavaScript SDK.
First, create a Wepin
instance and initialize the instance using the App ID and App Key assigned after app registration.
init
init
Initialize the Wepin
object through the init
method. Assign the App ID and App SDK Key allocated during the app registration process at initialization. Additionally, define the properties of the widget that are needed.
The parameters for init
are as follows.
appId
: String App ID assigned during registrationappKey
: String App Key assigned during registrationattributes
: Object (optional) Properties of the Wepin Widgettype
: String The type of display of widget asWepin
is initiated. The default value ishide
.show
: Show the widget window immediately after loading for the first time.hide
: Hide the widget window initially when loading and show it later usingopenWindow()
.defaultLanguage
: String The language to be displayed on the widget. The default value isko
. The currently supported languages areen
andko
.defaultCurrency
: String The currency to be displayed on the widget. The default value isKRW
. The currently supported currencies areUSD
andKRW
.loginProviders
: [String] Here is the list of login providers:google
,apple
,naver
, anddiscord
. Define and use only the necessary login providers. If you do not specify this value, all the four providers can be used by default.The
loginProviders
parameter is supported from@wepin/types
versionv0.0.11
or higher.
isInitialized
isInitialized
You can use isInitialized
to check if the Wepin object has been successfully initialized.
The returned value is as follows.
boolean init result;
true
if Wepin SDK is already initialized, otherwisefalse
.
Example
Last updated