Chapter 8. Developing a third-party JavaScript SDK

 

This chapter covers

  • Initializing an SDK synchronously and asynchronously
  • Exposing public functions
  • Versioning techniques
  • Wrapping and communicating with a web services API

Let’s flash-forward to the not-so-distant future. The Camera Stork product widget has been an unparalleled success, and is helping drive hundreds of thousands of visitors from publisher websites to camerastork.com each month. Publishers, too, are sharing in the success; you’ve even introduced a revenue-sharing program that pays publishers a share of each sale you make from visitors that are referred through the widget. And all of this thanks to a little book on third-party JavaScript—who knew?

It gets better. During this period, you’ve introduced new widgets to help increase traffic (and dollars), like the Top Sellers widget, which lists the current best-selling products on camerastork.com. These widgets are all served using separate, individual JavaScript files, loaded in the same fashion as your original product widget. You’ve also developed the Camera Stork Web Service API, a set of HTTP endpoints that provides programmatic access to the Camera Stork’s product and reviews database. Developers have been using this API to build revenue-generating applications that help refer you sales.

8.1. Implementing a bare-bones SDK

 
 

8.2. Versioning

 
 
 

8.3. Wrapping web service APIs

 
 
 

8.4. Summary

 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest