MySpace Developer Platform

A Place For Developers
From MySpace Open Platform: Documentation Wiki

MySpaceID JSL

Jump to: navigation, search
Content > MySpaceID > MySpaceID JSL

Contents

Introduction

The MySpaceID JSL (JavaScript Library) allows developers to create engaging social apps on websites outside of MySpace.com.

Among its several features, the MySpaceID JSL allows users to log into an external website, share profile information, and import friends. A unique feature of the MySpaceID JSL API (compared to the server side SDKs) is its ability to allow users to share activities (notifications that appear when a user posts a photo, adds a friend, updates their profile playlist, etc.) with friends in their activity streams.

With only a few lines of Javascript, and one Script include, developers will have access to an external OpenSocial v0.8 container, which is a subset of the OpenSocial v0.8 container for MySpace onsite apps. The MySpaceID JSL documentation includes details on which Opensocial APIs are available, as well as a few examples to get you started.

Publishing to the MySpace activity feed

Your off-site application (e.g., website) can use the MySpace JSL to publish activities back into MySpace, which will show up in the user’s activity feed. This allows you to drive traffic back to your site as well as help improve SEO and increase publicity for your site.

Differences between the MySpaceID JSL and other MySpaceID SDK’s

Server-side vs. client-side. Unlike the other SDK’s, which run on the server side, the JSL is a Javascript library, and hence it runs on the client side.

Off-site vs. on-site. Note that, while the SDK’s can be used for both off-site applications as well as iframed on-site applications, the JSL is designed for use with off-site applications only.

Activity posting. At the time of this writing, the JSL is the only library that allows an off-site application to post user activities. If your off-site application needs to post activities, you must use the JSL. It is possible to use the JSL running on the client side for activity posting in conjunction with an SDK running on the server side. On-site applications do not use the JSL and have their own way of posting activities.

Components of a MySpaceID JSL application

To set up your MySpaceID JSL application, you will need the following two things:

  • A JavaScript library on each page of your site where access to MySpace is needed. This library provides:
    • A login API for remotely verifying MySpace users.
    • An OpenSocial v0.8 implementation that allows remote access MySpace data.
  • A receiver file that should be located at the root of your site. This file allows MySpace to pass data to/from your site. Note that:
    • This file should be located in the root of your website
    • This file allows MySpace to communicate with the 3rd party site
    • The contents of this file must be copied directly from MySpace
    • A working example is provided in this wiki in Appendix A

Ready to start building? Let's Get Started!