The JS Buy SDK is deprecated as of January, 2025. For more information, please see the README.

Class: Client

Client(config)

The JS Buy SDK Client.

Constructor

new Client(config)

Parameters:
Name Type Description
config Config

An instance of Config used to configure the Client.

Properties:
Name Type Description
product ProductResource

The property under which product fetching methods live.

collection CollectionResource

The property under which collection fetching methods live.

shop ShopResource

The property under which shop fetching methods live.

checkout CheckoutResource

The property under which shop fetching and mutating methods live.

image ImageResource

The property under which image helper methods live.

Source:

Methods

(static) buildClient()

Primary entry point for building a new Client.

Source:

fetchNextPage(Arrayopt) → {Promise|Array.<GraphModel>}

Fetches the next page of models

Parameters:
Name Type Attributes Description
Array models <optional>

The paginated set to fetch the next page of

Source:
Returns:

A promise resolving with an array of GraphModels of the type provided.

Type
Promise | Array.<GraphModel>
Example
client.fetchNextPage(products).then((nextProducts) => {
  // Do something with the products
});