3 ms·
You can use adaptors for this. Adaptors let you request a third party API via the `adaptor` field type. Docs are limited, but there's a reference data shape he
by chrisvxd 3y ago
You can use adaptors for this. Adaptors let you request a third party API via the `adaptor` field type.
Docs are limited, but there's a reference data shape here: https://github.com/measuredco/puck#adaptor https://github.com/measuredco/puck#adaptor
Example implementation here: https://github.com/measuredco/puck/blob/main/packages/adaptor-strapi/index.ts https://github.com/measuredco/puck/blob/main/packages/adapto...
Example usage here: https://github.com/measuredco/puck/blob/main/apps/demo/app/configs/custom/blocks/Hero/index.tsx#L36-L46 https://github.com/measuredco/puck/blob/main/apps/demo/app/c...
You can either use it for a specific prop (i.e. `name`) or spread the result of the API call across your entire component (use the magic `_data` prop).
- chrisvxd 3y agoThis might be a better example, actually: https://github.com/measuredco/puck/tree/main/packages/adaptor-fetch https://github.com/measuredco/puck/tree/main/packages/adapto...