I've built a REST API and have been using Backbone models throughout a couple different applications to communicate to it.
I would really like to build a single JS SDK that can be used in any application that contains that reusable code.
I have started by creating an npm, bower, and component.json so that it can be easily installed.
From what I can gather the goal is to create a single object attached to the window
for access within other applications. At which point everything in is encapsulated.
I have a couple questions and concerns:
- Is there anything I need to avoid to prevent conflicts with other libraries?
- How do I handle dependencies? Should I encapsulate them or let the user know they have to add it?
- Are there any methods of structuring SDKs that provide similar benefits to, say, MVC within a web app?
NOTE: If this is question doesn't follow the guidelines for programmers.stackexchange.com please provide guidance on how to change it rather than just closing it. Thanks much.