Hook context
When building e-commerce integrations, your hooks often need to behave differently during testing or know which store is executing them. Hook context provides this environmental awareness to your hooks.
What is hook context?
Hook context is a parameter of the hook function that provides information about the hook's environment, like test mode status and store details.
Available properties
Common use cases
Here's how to use hook context to create smarter hooks:
Best Practices
- Check isTestMode when making external API calls
- Use shopifyDomain for logging and tracking store-specific issues