Salla Docs
Merchant API
  • Merchant API
  • Salla OAuth 2.0
Partner APIs
  • App API
  • Shipment API
Storefront
  • Twilight Engine
  • Twilight SDK
  • Web Components
  • Change Log
Salla CLI
Merchant API
  • Merchant API
  • Salla OAuth 2.0
Partner APIs
  • App API
  • Shipment API
Storefront
  • Twilight Engine
  • Twilight SDK
  • Web Components
  • Change Log
Salla CLI
Salla - Opensource
Salla - Developers Community
  1. Twilight SDK
  • Overview
  • Languages
  • Notify
  • Event
  • Storage
  • Configuration
  • Forms
  • Helpers
  • Auth
    • Login
    • Logout
    • Verify
    • Resend
    • Register
    • Refresh
  • Cart
    • Latest
    • Details
    • Quick Add
    • Add Item
    • Delete Item
    • Delete Image
    • Add Coupon
    • Remove Coupon
    • Get Upload Image
    • Get Quick Order Settings
    • Create Quick Order
    • Order Status
    • Get Current Cart Id
    • Price Quote
  • Wishlist
    • Add
    • Remove
    • Toggle
  • Loyalty
    • Get Program
    • Exchange
    • Reset
  • Comment
    • Add Comment
    • Fetch
    • Get Page Comments
    • Get Product Comments
  • Profile
    • Update profile
    • Update contact
  • Product
    • Get price
    • Product availability
    • Categories
    • Offer details
    • Search products
    • Get Gift Details
    • Add Gift To Cart
    • Upload Gift Image
    • Get Product Details
    • Fetch
    • Fetch Options
    • Size Guides
  • Order
    • Create cart from order
    • Cancel
    • Send invoice
    • Show order
  • Booking
    • Add
  • Rating
    • Order
    • Store
    • Products
    • Shipping
  • Currency
    • Change
    • List
  • Component
    • Reviews
    • Menus
  1. Twilight SDK

Configuration

When the Twilight JS SDK is first loaded, the initialization procedure is used to obtain the necessary configuration settings. The developer has the ability to configure the Twilight engine to meet the needs of his theme
TIP
✅ Twilight JS SDK can be customized by selecting from a number of different configurations. When the SDK is first initialised, the configurations are set to their default values.
✅ 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().
In this article, we will explore the different parts of the Twilight JS SDK.

📙 What you'll learn#

Configurations
Usage
Set SDK's configurations
Get SDK's configurations

Configurations#

Here is a comprehensive list of all of the available configurations:
Twilight JS SDK - List of the available configurations

Usage#

As we stated before, the developer can configure the Twilight engine to meet the requirements of his theme.

Set SDK's configurations#

In general, the configuration can be set during the SDK initialization by calling 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#

Here is an example of how to set any value related to the store via the salla.init() method.
Similarly, we can see below how to set any value related to the store via the salla.config.set() method.

Set theme configuration#

Here is an example of how to set any value related to the theme via the salla.init() method.

Get SDK's configurations#

Similarly, the developer can use the salla.config.get() method to retrieve any value from the configuration file. For example, the user.id can be retrieved using the syntax below.
Furthermore, for the currencies and languages, the following syntax can be followed:
Similarly, the list of the available laguges can be retrieved as follows:
Modified at 2025-03-04 12:54:02
Previous
Storage
Next
Forms