Hi @mattohoh ,
I believe the best way is to turn your shared code into an npm package and upload it as a dependency to realm:
https://docs.mongodb.com/realm/functions/upload-external-dependencies/
Than look how to require it in your functions.
Thanks
Pavel