webflow / js-webflow-api

Node.js SDK for the Webflow Data API
https://www.npmjs.com/package/webflow-api
285 stars 92 forks source link

Add pagination options to `pages.getContent` #148

Open pjlangley opened 1 month ago

pjlangley commented 1 month ago

There's not a way to do pagination on the webflow.pages.getContent method.

Ideally, you should be able to do something like the following so that you can cycle through the DOM nodes:

await webflow.pages.getContent('<page_id>', { offset: 100 });

Via the REST API, you can achieve it like so:

https://api.webflow.com/v2/pages/{page_id}/dom?offset=100

getContent currently only supports locale in the query params:

https://github.com/webflow/js-webflow-api/blob/21c2b0fd6ef44a0bfea0a1f0099d64b6e10f86f1/src/api/resources/pages/client/Client.ts#L332-L341

Unlike webflow.pages.list, which can do pagination:

https://github.com/webflow/js-webflow-api/blob/21c2b0fd6ef44a0bfea0a1f0099d64b6e10f86f1/src/api/resources/pages/client/Client.ts#L39-L56

zplata commented 1 month ago

Thanks @pjlangley! We'll look into fixing this