Take records from Airtable and add them to Atlas databese Nextjs

Hi all. I have a nextjs site and a Realm function which I intend to use to add records from an Airtable base. I’m using the Airtable SDK, Airtable.js

Not sure if I should be doing this in index.js inside a getStaticProps function or in a function of its own?