Being able to build JS experiences without dealing with heavy server-side logic and hosting, etc. opens up the platform to so many more smart people wanting to do stuff, and really changes what people think commerce can be.
The SDK helped extrapolate the myriad of API endpoints into a neat logical set of interactor methods that could be used simply and quickly in a frontend application.
Our JS SDK went from being a few files to growing into several different sets of files compiled down into different usable modules.
We also wanted to bring more help and functionality to the NodeJS community, but our various releases for NodeJS ended up being a consistently buggy and difficult experience. Something we didn’t want for our users and never seemed to be able to get working solidly under the original interpretation.
So, we were reaching a point where we were running up against a wall. The SDK was too brittle to continue bending and warping to fit our users’ needs, and the time it was taking for users to get the features and benefits from any changes was far too long to be useful.
We took the decision to basically scrap the old SDK and start afresh. Key problems we wanted to address immediately were:
- Removal of CoffeeScript
- Fully tested
- Automatic authentication
With the overall objectives of:
- Releasing a solid piece of work to build on
- Maintaining correct semver off a base version
- Follow standard patterns to increase the overall support base
The automated authentication was one of the bugbears of the first SDK, but the new version will simply queue up a call from the front-end whilst it retrieves a new access token and sends the call on with the new credentials, without the developer having to worry about storing and evaluating dead credentials.
Our test coverage has expanded from 0 to between 60 and 70 tests. That’s 0% to about 85% test coverage.
By re-envisioning the SDK we’re putting in place a solid foundation on which we can start building better functionality and longer-term goals with our community of developers and our team within moltin.
We have some amazing features coming out soon, and having that solid foundation will mean we can deliver that functionality quicker and smarter than before.