Importing secure code


I am little unclear on the ‘secure sever code’ section of the guide as to how code remains secure and accessible. I understand that you can place code in a server directory and call it from a place where code it shared, but how does this work with imports?

Won’t you need to import the secure function into the shared code location so it works on the server. Yet, that secure code is not available on the client, as expected, so will create an error. Is there some sort of conditional import you have to set up (depending on whether the code is run on the server or client) to make this work?

Could someone let me know where my understanding on this topic is lacking.

Many thanks.

Secret server code. Info missing on meteor guide. Here are some infos, but I am still struggling with it.