Skip to main content
This section describes the Global-e SDK. In this section:

Base Global‑e Script

Depending on your Global-e integration type, the Global-e SDK may be included all your storefront pages automatically. Please check with your Global-e CSM if you are unsure.
You can host the SDKJavaScript file locally or be served from the Global-e servers. If you would like to host the file on your servers, you can download the script from the following location by replacing the appropriate parameters:
To load our base script, you should use a self-invoking function: (<window>, <document>, <sDomain> + <clientJsURL>, “script”, “gle”, <scriptVersion>, <merchantId>) Production Example:
Code Sample
Script Parameters
ParameterDescription
sDomainProduction: https://web.global-e.comIntegration: https://www.bglobale.comStaging: https://www2.bglobale.com
windowThe JavaScript window object
documentThe JavaScript document object
clientJsURLLocal file path or direct to Global‑e servers/merchant/clientsdk/<merchantId>?v=<scriptVersion>
ScriptVersionThe version of Global-e server API.Currently 2.1.4.
merchantIdThe current Merchant ID
This script loads the Global-e client script asynchronously. The Global‑e client script uses an asynchronous approach so that you can start calling actions immediately; these actions are executed once the script is fully loaded.
This list is subject to modifications and limitations that may affect the availability of payment methods on the checkout page.

Events Summary

This section summarizes the events exposed by the Client SDK library.
When using the Global-e Module platform, make sure to incorporate the following line prior to registering for the events detailed in this section. Note that the correct queue name for event registration is “glegem” (and not “gle”).

OnBeforeWelcome

This event occurs before the Welcome pop-up is displayed.

OnWelcomeShown

The OnWelcomeShown event is fired when the welcome pop-up is shown to the customer.
See ???.

OnChangeShippingCountryClicked

The OnChangeShippingCountryClicked event is fired when the “change shipping country” link on the welcome pop-up is clicked.
For more information.

OnBeforeSwitcher

The OnBeforeSwitcher event is fired before the country and currency pop-up is shown.
For more information, see ???.

OnWelcomePopupClosed

The OnWelcomePopupClosed event is fired after the welcome pop-up is closed.
For more information, see ???.

OnShippingSwitcherClosed

The OnShippingSwitcherClosed event is fired after the country and currency pop-up is closed.
For more information, see ???.

OnCheckoutStepLoaded

The OnCheckoutStepLoaded event is fired twice when the checkout is first loaded. then when it is complete.

OnClientEvent

The OnClientEvent is fired when the customer interacts with the checkout.
For more information, see ???

QuerySessionValidity

The QuerySessionValidity event is used to cause the checkout session to expire after a specified amount of time.
Note:
  • If this feature is not implemented, the checkout will stay open indefinitely until the shopper clicks the place order button. Once the timer expires, a pop-up will redirect the customer back to the cart page.