Get caller/initializer of Actor (not class) in Motoko

Is there an actor equivalent to this actor class syntax to get the initializer?

shared({ caller = initializer }) actor class MyClass() {

This does not work
shared ({ caller = initializer }) actor {

I can use an actor class, but am just trying to avoid it if possible

No, unfortunately, not. At the moment, if you want access to the installer, you need to declare a class.

2 Likes