API Reference
Methods and inputs for each client domain.
This page summarizes the HEBClient surface and key helpers.
Use it as a quick map before diving into type definitions.
Use the client
Create a client with a HEBSession and reuse it across calls.
Use setDebug, isValid, and getSessionInfo for runtime checks.
import { HEBClient } from "heb-sdk-unofficial"
const heb = new HEBClient(session)heb.setDebug(true)
console.log(heb.isValid())console.log(heb.getSessionInfo())Search products
Search and buy-it-again require bearer auth and a store ID. Typeahead works with either auth mode.
search(query, options)usesSearchOptionslikelimit,storeId,shoppingContext, andincludeImagesgetBuyItAgain(options)uses the same options withsearchModeset toBIA_SEARCHtypeahead(query)returns recent and trending terms
Fetch product details
Product details require bearer auth and a store ID.
getImageUrl is local and needs no session.
getProduct(productId, { includeImages })returns aProductgetSkuId(productId)looks up the SKU for cart operationsgetImageUrl(productId, size)builds an image URL
Manage cart
Cart reads work with cookie or bearer sessions. Mutations set quantities rather than incrementing.
getCart()returns the fullCartaddToCart(productId, skuId, quantity)sets the quantity and accepts a missingskuIdupdateCartItem(productId, skuId, quantity)is an alias ofaddToCartremoveFromCart(productId, skuId)sets quantity to0quickAdd(productId, skuId)sets quantity to1addToCartById(productId, quantity)auto-resolves the SKU
Track orders
Orders require bearer auth. Results include normalized fields plus the raw GraphQL payloads.
getOrders({ page, size })returnsOrderHistoryResponsegetOrder(orderId)returnsOrderDetailsResponse
Work with lists
Shopping list queries use web persisted queries and expect an authenticated session. Cookie sessions are the safest default if mobile queries change.
getShoppingLists()returnsShoppingListsResultgetShoppingList(listId, { page, size, sort, sortDirection })returnsShoppingListDetails
Handle fulfillment
Slots are available for delivery or curbside. Reservations require a logged-in session.
getDeliverySlots({ address, days })returnsFulfillmentSlot[]getCurbsideSlots({ storeNumber, days })returnsFulfillmentSlot[]reserveSlot(slotId, date, address, storeId)reserves delivery slotsreserveCurbsideSlot(slotId, date, storeId)reserves pickup slots
Find stores
Store search uses the web GraphQL endpoint.
setStore updates the session cookie and server context for cookie auth.
searchStores(query)returns matching store locationssetStore(storeId)setsCURR_SESSION_STOREsetShoppingContext(context)sets the browse mode
Load homepage
Homepage content requires bearer auth and a store ID.
Filters in HomepageOptions let you include or exclude sections.
getHomepage(options)returnsHomepageData
Read weekly ad
Weekly ad calls require bearer auth and a store ID.
Use category and cursor to paginate.
getWeeklyAdProducts({ storeCode, category, limit, cursor })returnsWeeklyAdResult
Access account
Account profile calls require bearer auth. Results include profile fields and saved addresses.
getAccountDetails()returnsAccountDetails
Call graphql
Use helpers when the SDK lacks an endpoint. Operation names must match the persisted query hashes.
persistedQuery(session, operationName, variables)graphqlRequest(session, payload)ERROR_CODES,hasErrorCode, andgetErrorMessagesfor error inspection
Format output
Formatters build display-friendly strings for UI or logs.
Use formatter or the formatX functions.
formatter.cart,formatter.productDetails,formatter.orderHistory,formatter.orderDetailsformatter.shoppingLists,formatter.shoppingList,formatter.weeklyAd,formatter.weeklyAdCategoriesformatter.homepage,formatter.storeSearch,formatter.deliverySlots,formatter.curbsideSlots