How can I migrate custom Klaviyo functionality into a custom app?

Hello,

We have a custom Klaviyo functionality in checkout.liquid and I was wondering if anyone has already done that type of migration?

For example, when I create a custom app where I will add my Klaviyo custom functionality I struggle to find how to access the theme settings so I can fetch and pass some theme settings variables to Klaviyo API?