heb-sdk-unofficial
Overview
Use this skill to integrate the heb-sdk-unofficial client into apps and automations. Focus on the session model, store context, and which endpoints require bearer vs cookie auth.
Workflow
- •Identify the feature you need and its auth requirements.
- •Load
references/client-methods.mdfor the method map.
- •Load
- •Build the correct session.
- •Cookie session for web GraphQL features.
- •Bearer session for mobile GraphQL features.
- •Load
references/sessions-auth.mdfor details and refresh patterns.
- •Set context before calls that need it.
- •Store context is required for search, product details, homepage, and weekly ad.
- •Shopping context affects availability and fulfillment.
- •Call SDK methods through
HEBClientunless you need an unsupported operation.- •Use
persistedQuery/graphqlRequestonly when required. - •Load
references/graphql-helpers.mdfor operation-name rules.
- •Use
- •Debug and handle errors.
- •Enable
heb.setDebug(true)orsession.debug = true. - •Load
references/troubleshooting.mdfor common failures.
- •Enable
Implementation Guidelines
- •Prefer
HEBClientin app code; use exported functions for lower-level control or tree-shaking. - •Keep credentials in env vars (
HEB_COOKIES,HEB_ACCESS_TOKEN, etc.). Never hard-code tokens. - •Always call
setStore()(or setCURR_SESSION_STORE) before store-dependent calls. - •Cart mutations set quantity (not increment). Read the cart if you need to add relative quantities.
Reference Files
- •
references/overview.md: package layout, core concepts, and endpoint split. - •
references/sessions-auth.md: session creation, refresh, and context tips. - •
references/client-methods.md: HEBClient method map and auth requirements. - •
references/graphql-helpers.md: persisted query rules, error codes, and operation mapping. - •
references/types-and-formatters.md: key types and formatter utilities. - •
references/troubleshooting.md: common errors and fixes. - •
references/examples.md: copy-ready usage snippets.