Skip to content

Latest commit

 

History

History
48 lines (36 loc) · 2.61 KB

README.md

File metadata and controls

48 lines (36 loc) · 2.61 KB

JsApiToolkit

JsApiToolkit is project which seeks to provide a platform for building feature-rich JavaScript API's similar to e.g. Facebook Connect.

The base implementation provides Cross-Document Messaging, user interaction and basic authentication support, and is completely event driven using a pub/sub model.

You can easily configure the core library, set its export name, and provide custom modules so that it matches your need.

You can see a demo of the base API here.

How it works

JsApiToolkit provides both a server and a client component.
It is built around a generic model supporting the use of an appKey to identify the consumer, and it also supports the notion of end-user authentication, both as something happening prior to the API being activated, and as an action that can be triggered on demand.

Essential to the architecture of the API is the Cross Document Messaging link used to communicate between the two domains. This allows state-aware communication between the two separate documents (client <> server) instead of having to resort to JSONP (client > server > client).
JsApiToolkit is based on easyXDM and so do not need any additional files uploaded to the consumer in order to provide fast communication.

Server

The server component is a HTML document, which is to be hosted on the domain from where you want to expose your services. You are free to decide how to connect this with your back-end as long as the document is not navigated. Client

The client is the main library that your users will include on their sites. This will in turn connect to the server in order to provider state-aware communication between the consuming document and your providing server. The client exposes the base functionality as well as any additional modules added.

How to get started

  • Modify main configuration in /src/client/core.js so that it reflects the desired name and location of the server components.
  • If necessary, modify the XDM api. The base implementation exposes a generic api method on the server, and a publish method on the client for event notifications.
  • Add your custom modules to /src/client/modules/ following the pattern used in the existing modules.
  • Build the client library using ant build.
  • Deploy! :)

Note that this is a work in progress. License

This is provided under the MIT license

Author

Øyvind Sean Kinsey [email protected] - http://kinsey.no/