Skip to main content

Polywrap vs. JavaScript SDKs


Polywrap is a substantial improvement over JavaScript SDKs and produces a seamless and intuitive Web3 protocol integration experience for blockchain developers.

The table below highlights the contrasts between JavaScript SDKs and Polywrap Wasm wrappers as it concerns compatibility & maintainability, ease of use, bundle size, and upgrades & patches.

CategoryPolywrap wrapperJavaScript SDK
Compatibility & MaintainabilityWasm wrappers run in any environment, meaning you just need to program your SDK once -- saving you time.JS-based SDKs require JS-based apps in order to run, thereby disincentivizing developers from building apps in other languages. Supporting new app "types" requires writing and maintaining a new SDK.
Easy of UseDevelopers interact with Polywrap through simple syntax, making them as easy to use as Web2 APIs like Twitter's.Developers must learn how to instantiate classes, and call into the various methods and functions the JS SDK provides.
SecurityWasm wrappers run within individual sandboxes, ensuring your integrations are isolated from your application. Users are safer with Polywrap.JavaScript SDKs, and any other type of traditional SDK, execute unbounded within your application's memory. This means that the SDK, and all of its dependencies, have direct access to the user's data within your applications. This has lead to many hacks in the past, leaving users vulnerable and with a large loss of funds.
Bundle SizeWasm wrappers do not affect your app's bundle size, since Wasm wrappers are downloaded at runtime from a decentralized endpoint like IPFS.JavaScript SDKs are installed using npm, and embedded into your app's bundle, increasing the overall size of the application.
Upgrades & PatchesSince Wasm wrappers are resolved at runtime, this allows for optional automatic updates, in the event the app is invoking an updatable URI (such as an "ENS" domain).Since JS SDKs are bundled into applications, when new patches or features are released, the application must be rebuilt with the latest version. If breaking backend (smart contract) upgrades are performed, this would render the application broken until you rebuild with the latest SDK.