Wagtail CMS Integration with B2storefront
Evaluate ways to integrate
each CMS is different, some would be SaaS platform that only offer connection via API (GraphQL or JSON REST API's) some are self-hosted where database is possible to be reached and fetch data from there.
to evaluate ability for integrating B2storefront with Wagtail CMS we need to take a look on offered API's below is the link to their API: https://docs.wagtail.org/en/stable/advanced_topics/api/v2/usage.html#fetching-content
If Wagtail used for eCommerce type of website we need to fetch following content types:
- Content Pages from CMS
- Product Information from CMS
Estimated time to complete: 32-50h
Monitoring for data updates
Besides the fact that data needs to be fetched once we need to fetch it again either on schedule (using cronjob) or based on webhooks that CMS will send whenever the item is changed
It looks like Wagtail doesn’t support a standard webhooks after any content is changes so we have two approaches:
- Cronjob which runs every X minutes and check for changes - can be tricky to find a nice spot between expectation on how fast data updates are visible online vs API rate limiting
- Create custom Hooks in Wagtail codebase to ping connector about changes
Documentation: https://docs.wagtail.org/en/stable/reference/hooks.html
Estimated time to complete: 16-32h