import HTML5Kinvey from 'kinvey-html5-sdk';
import Device from './device';
import Popup from './popup';
import Push from './push';
import assign from 'lodash/assign';

class Kinvey extends HTML5Kinvey {
  static init(options = {}) {
    options = assign({
      deviceClass: Device,
      popupClass: Popup
    }, options);

    // Initialize Kinvey
    return super.init(options);
  }
}

// Add Push module
Kinvey.Push = Push;

// Export
export default Kinvey;

import HTML5Kinvey from 'kinvey-html5-sdk';
import Device from './device';
import Popup from './popup';
import Push from './push';
import assign from 'lodash/assign';

export default class Kinvey extends HTML5Kinvey {
  static init(options = {}) {
    options = assign({
      deviceClass: Device,
      popupClass: Popup
    }, options);

    // Initialize Kinvey
    const client = super.init(options);

    // // Add Push module to Kinvey
    this.Push = new Push({ client: client });

    // Return the client
    return client;
  }
}

--- 
+++ 
@@ -4,7 +4,7 @@
 import Push from './push';
 import assign from 'lodash/assign';
 
-export default class Kinvey extends HTML5Kinvey {
+class Kinvey extends HTML5Kinvey {
   static init(options = {}) {
     options = assign({
       deviceClass: Device,
@@ -12,12 +12,12 @@
     }, options);
 
     // Initialize Kinvey
-    const client = super.init(options);
-
-    // // Add Push module to Kinvey
-    this.Push = new Push({ client: client });
-
-    // Return the client
-    return client;
+    return super.init(options);
   }
 }
+
+// Add Push module
+Kinvey.Push = Push;
+
+// Export
+export default Kinvey;
Make push module a singleton
