The way standard sjcl library provides support for Node.js, interferes with modern bundlers and causes errors. We switch to custom sjcl build that only includes functions we need in Accounts SDK. As a result, function that relies on troublesome require() is ommited and final library size is greatly reduced, from ~46kb (15kb gzipped) to ~25kb (9kb gzipped).
Although native Web Crypto API exists and offers functions we need, Accounts relies on internal sjcl hash format (array of big-endian words) instead of hex representation, so switch was not straightforward.
The way standard sjcl library provides support for Node.js, interferes with modern bundlers and causes errors. We switch to custom sjcl build that only includes functions we need in Accounts SDK. As a result, function that relies on troublesome
require()
is ommited and final library size is greatly reduced, from ~46kb (15kb gzipped) to ~25kb (9kb gzipped).Although native Web Crypto API exists and offers functions we need, Accounts relies on internal sjcl hash format (array of big-endian words) instead of hex representation, so switch was not straightforward.