Skip to content

📚 docs(document): add getting-started pages for core and hooks packages#738

Draft
acasazza wants to merge 2 commits intov5.0.0from
v5/docs/getting-started-core-hooks
Draft

📚 docs(document): add getting-started pages for core and hooks packages#738
acasazza wants to merge 2 commits intov5.0.0from
v5/docs/getting-started-core-hooks

Conversation

@acasazza
Copy link
Copy Markdown
Member

@acasazza acasazza commented Apr 7, 2026

Summary

Closes #737

Add two new MDX pages to the Storybook getting-started section describing the internal core and hooks packages.

New pages

006.core.mdx@commercelayer/core

  • What it is and when to use it directly (no React dependency)
  • Full table of exported functions (getSkus, retrieveSku, updateSku, getPrices, retrievePrice, updatePrice, getSkuAvailability, getSkuLists, retrieveSkuList, getAccessToken)
  • Consistent function signature pattern ({ accessToken, params, options })
  • Code examples: authentication, filtered SKU list, SKU list with included SKUs

007.hooks.mdx@commercelayer/hooks

  • What it is and when to use it directly
  • Full table of exported hooks (useSkus, usePrices, useSkuLists, useAvailability)
  • Return shape reference table (data, isLoading, isValidating, error, fetch/retrieve/update/clear actions, mutate)
  • SWR caching behaviour explained
  • Code examples: useSkus, useSkuLists, usePrices, useAvailability

Test plan

  • pnpm storybook starts without errors in packages/document
  • Storybook sidebar shows "Getting Started / Core package" and "Getting Started / Hooks package"
  • All tables, code blocks, and callout spans render correctly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant