Configuration
TIP
✅ In the case of using these configurations in a separate project other than the theme's pages, the SDK needs to be initialized via
salla.init()
.📙 What you'll learn
Configurations
Twilight JS SDK - List of the available configurations
maintenance
enum<boolean>
optional
true
.Allowed values:
truefalse
debug
enum<boolean>
optional
true
, this means that the developer can track any changes in variables and methods.Allowed values:
truefalse
events
object
optional
Additional properties
integer | number | string | boolean
optional
store
object
required
url
string
required
Example:
https://my_store.test/
id
number
required
Example:
12345
logo
string
optional
Example:
https://my_store.test/store_logo.png
name
string
optional
Example:
Coach .co
settings
object
optional
user
object
optional
type
enum<string>
optional
Allowed values:
userguest
mobile
string
optional
Example:
+9665123456
language_code
string
optional
Example:
ar
currency_code
string
optional
Example:
SAR
country_code
string
optional
Example:
SA
theme
object
optional
name
string
optional
mode
enum<string>
optional
Allowed values:
livepreview
translations_hash
string
optional
color
object
optional
languages()
array [object {5}]
Promise
name
string
optional
code
string
optional
url
string
optional
is_rtl
string
optional
country_code
string
optional
currencies()
array [object {5}]
optional
code
string
optional
Example:
SAR
name
string
optional
Example:
ريال سعودي
symbol
string
optional
Example:
$
amount
number
optional
country_code
string
optional
Example:
sa
page
object
optional
title
string
optional
slug
string
optional
in an easy-to-read form
id
number
optional
Usage
Set SDK's configurations
salla.init()
. Also, after the initialization, the developer can set any of the confiurations by calling the method salla.config.set()
. Following, we see how the developer would be able to set the SDK configurations using each of these ways.Set store configuration
salla.init()
method.
salla.config.set()
method.
Set theme configuration
salla.init()
method.
Get SDK's configurations
salla.config.get()
method to retrieve any value from the configuration file. For example, the user.id
can be retrieved using the syntax below.
Modified at 2025-03-04 12:54:02