Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Connector

The main connector interface. An implementation of this interface should be the default export from your connector package.

Hierarchy

  • Connector

Index

Properties

addToCart

addToCart: (product: Product, quantity: number, request: Request, response: Response) => Promise<CartResponse>

Adds product to cart

param

the product to add

param

the quantity of product to add

param

The http request

param

The http response

Type declaration

    • (product: Product, quantity: number, request: Request, response: Response): Promise<CartResponse>
    • Parameters

      • product: Product
      • quantity: number
      • request: Request
      • response: Response

      Returns Promise<CartResponse>

cart

cart: (request: Request, response: Response) => Promise<Result<CartResponse>>

Returns data for the cart page

param

The http request

param

The http response

Type declaration

home

home: (request: Request, response: Response) => Promise<Result<HomePageData>>

Returns data for the home page

Type declaration

product

product: (params: ProductParams, request: Request, response: Response) => Promise<Result<ProductPageData>>

Returns data for the PDP

param

Criteria used to look up the product and variant

param

The http request

param

The http response

Type declaration

productSlots

productSlots: (params: ProductSlotsParams, request: Request, res: Response) => CmsSlots

Returns the HTML for a late-loaded CMS slot on the product page. For example, it's common to late load reviews as an HTML blob retrieved from a 3rd party review provider.

Type declaration

productSuggestions

productSuggestions: (id: string, request: Request, response: Response) => Promise<Product[]>

Returns suggested products based on a product being viewed

param

The product id

param

The http request

param

The http response

Type declaration

    • (id: string, request: Request, response: Response): Promise<Product[]>
    • Parameters

      • id: string
      • request: Request
      • response: Response

      Returns Promise<Product[]>

removeCartItem

removeCartItem: (item: CartItem, request: Request, response: Response) => Promise<CartResponse>

Removes item in the cart

param

The item to remove

param

The http request

param

The http response

Type declaration

routes

routes: Route[]

Routing rules that map express-style path expressions to next.js page routes. Use routes to map the URL used by the target platform to standard routes in the React Storefront starter app.

For example, if the platform uses /products for product pages instead of /p, use:

[{ source: '/products/:productId', destination: '/p/[productId]' }]

search

search: (params: SearchParams, request: Request, response: Response) => Promise<Result<SearchResult>>

Searches for matching products

param

The http request

param

The http response

Type declaration

searchSuggestions

searchSuggestions: (query: string, request: Request, response: Response) => Promise<SearchSuggestions>

Returns suggestions based on the user's search text

param

The user's search text

param

The http request

param

The http response

Type declaration

    • Parameters

      • query: string
      • request: Request
      • response: Response

      Returns Promise<SearchSuggestions>

session

session: (request: Request, response: Response) => Promise<Session>

Retreives session information

param

The http request

param

The http response

Type declaration

    • (request: Request, response: Response): Promise<Session>
    • Parameters

      • request: Request
      • response: Response

      Returns Promise<Session>

signIn

signIn: (email: string, password: string, request: Request, response: Response) => Promise<Session>

Signs the user in to their account

param
param
param

The http request

param

The http response

returns

data to apply to the session

Type declaration

    • (email: string, password: string, request: Request, response: Response): Promise<Session>
    • Parameters

      • email: string
      • password: string
      • request: Request
      • response: Response

      Returns Promise<Session>

signOut

signOut: (request: Request, response: Response) => Promise<Session>

Signs the user out

param

The http request

param

The http response

Type declaration

    • (request: Request, response: Response): Promise<Session>
    • Parameters

      • request: Request
      • response: Response

      Returns Promise<Session>

signUp

signUp: (data: SignUpData, request: Request, response: Response) => Promise<Session>

Signs the user up for an account

param

Data to apply when creating the account

param

The http request

param

The http response

Type declaration

subcategory

subcategory: (params: SubcategoryParams, request: Request, response: Response) => Promise<Result<SubcategoryPageData>>

Returns data for the PLP

param

Criteria used to look up the subcategory

param

The http request

param

The http response

Type declaration

updateCartItem

updateCartItem: (item: CartItem, quantity: number, request: Request, response: Response) => Promise<CartResponse>

Updates an item in the cart

param

The item to update

param

The new quantity to apply

param

The http request

param

The http response

Type declaration

    • Parameters

      • item: CartItem
      • quantity: number
      • request: Request
      • response: Response

      Returns Promise<CartResponse>

Generated using TypeDoc