In the JVM, static fields in a class are initialized when the class is first used. And Kotlin properties at the top level are stored in static fields.
So, once anything in that file is used (like a function, or something else), then the field will be initialized. If there’s a function that must be called in order to use your library, then putting it in the same file as that property will guarantee it’s initialized (and it’ll be initialized before the function’s called)