Home / Companies / PubNub / Blog / Post Details
Content Deep Dive

What’s New in JavaScript SDK V.4

Blog post from PubNub

Post Details
Company
Date Published
Author
Michael Carroll
Word Count
722
Language
English
Hacker News Points
-
Summary

The JavaScript SDK has been upgraded to version 4, offering a complete rewrite to enhance performance, reduce its footprint, and introduce easier-to-use APIs, including features like isomorphic JavaScript compatibility with platforms such as Node, Web, and React, alongside unified presence, message, and status notifiers across multiple V4 SDKs. This version includes ES6 native classes, reworked cryptography for a lighter footprint, verbose logging options, and new reconnection policies for better handling of mobile client connectivity issues. Key changes in APIs include the adoption of an event emitter pattern over callbacks, the ability to handle multiple channels with arrays during subscription, and additional parameters in the publish function for enhanced functionality. The SDK can be used on the web through a script tag or installed via npm for Node.js, with the choice between ES5 and ES6 code integration, and users are advised to refer to the JavaScript SDK v4 Documentation for further details on the differences from version 3.x.