Initialization
Here is the instructions on how to initialize the Wepin Widget Javascript SDK.
init
It initializes the Wepin SDK. Defines the attributes needed for the widget during initialization.
Parameters
attributes
<object> optionaltype
<string> It determines how to display the app widget window on the first load. The default value ishide
. Currently, onlyhide
is supported.hide
hides the widget window on the first load. The widget window can be displayed later usingopenWindow()
.defaultLanguage
: <string> It sets the default language of the widget. The default value isko
. Currently, supported languages areen
andko
.defaultCurrency
: <string> It sets the default currency of the widget. The default value isKRW
. Currently, supported currencies areUSD
andKRW
.loginProviders
: <string[]> optional It's the list of login providers. Currently, supported providers aregoogle
,apple
,naver
, anddiscord
. Define only the necessary login providers.If this value is not specified, all provided providers can be used.
If an empty array is provided, only email login is available. (Supported from version v0.0.3)
Return value
Promise
<void>
Example
isInitialized
It checks if WepinSDK is initialized properly.
Parameters
<void>
Return Value
<boolean>
It returnstrue
if init was successful, otherwise returnsfalse
.
Example
changeLanguage
It allows changing the language and currency of the widget.
Parameters
language
<string> It specifies the language to be displayed in the widget. Currently, supported languages areen
andko
.currency
<string> It specifies the currency to be displayed in the widget. Currently, supported currencies areUSD
andKRW
.
Example
Last updated