livechat / accounts-sdk

SDK for 'Sign in with LiveChat'.
https://developers.livechat.com/building-apps-crash-course/livechat-apis/
MIT License
2 stars 3 forks source link

Switch to custom sjcl build #10

Closed dmgawel closed 2 years ago

dmgawel commented 2 years ago

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.