Global variable in Cordova Plugin

I am wondering how I get my Cordova Plugin to allow access through a global variable

Currently it works like this:
'window[‘plugins’].myPluginName.method…"

But I’ve seen plugins have their own global variable so it works like this:
‘MyPluginName.method…’