How can I get the record ID from inside custom js?

Using sugar 7.6 on a BWC module.

Inside detailviewdefs.js, you can include javascript files using the 'includes' key.  How can I get the current record ID from inside my custom.js file?

Do I need to use

(function(app) {
//code here?
})(SUGAR.App);

or can I just use  SUGAR.App.something.... or is it app.something?

There is no documentation for the JS so i'm stuck.