DXIM-344 [PRELOAD HOOK] - Add example in extension_sdk repository#34
Open
sarah-zatar wants to merge 6 commits intomainfrom
Open
DXIM-344 [PRELOAD HOOK] - Add example in extension_sdk repository#34sarah-zatar wants to merge 6 commits intomainfrom
sarah-zatar wants to merge 6 commits intomainfrom
Conversation
Custom component (sdk_script) positioned on pim.product.header that demonstrates a "preload hook" pattern: on mount, it fetches product info via PIM.api.product_uuid_v1.get() and displays simulated external data (stock availability, pricing, compliance) without user interaction.
Add a commented example of PIM.api.external.call() in useProductInfo.ts to show how to fetch data from an external service (ERP, pricing, etc.). Update README with a new "Calling an external API" section.
Add a commented example of PIM.custom_variables usage alongside the existing api.external.call example in useProductInfo.ts. Reorganize README into a "Connecting to your own tools" section covering both config-based (custom_variables) and API-based (external.call) hooks.
- Rename useProductInfo hook to usePreLoadData (file, interface, exports) - Move commented examples (external API, custom_variables) to top of hook - Invert example order: external API call is now EXAMPLE 1, custom_variables is EXAMPLE 2 - Add product model support: use context.product.uuid for products, context.product.identifier for product models - Replace stock/price/compliance with certification and expiration badges - Add supported positions table in README (product, product-model, sub-product-model headers) - Set transparent background on html/body for iframe styling Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace simulated data with a certification expiration message using custom_variables for the date. Simplify App.tsx rendering, update labels to "Certification notification", and document the certification_expiration_date custom variable in the README. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Product:

Product Model
