Configured JavaScript and css files are attached to the plugin wrapper. The gadget configuration screen looks next:

Unless you create very basic gadget you need to define AMD entry module that returns a function. The function is called by the plugin wrapper code and API object is passed as an argument. The entry module can be defined in one of the loaded scripts that are in "JavaScript URLs" field or can be declared as inline JavaScript in "JavaScript to run" editor. Make sure to put matching name to "AMD module" field.
 

define("SomeAMDEntry", [ "jquery" ], function($) {
  var MyGadget = function(API) {
  };
  return MyGadget;
});


The API object has following methods:

Please see API Calls sample for live demonstrations of the API methods usage.