7. Javascript SDK

The Javascript SDK has been deprecated on 2014, June 30rd and will be removed on 2015, January 1st.

With the javascript SDK you can easily integrate Spreaker with your website.

What's this?

The SDK enables cross site XHR communication from your website and the Spreaker API. It's a cross browser implementation based on HTML5 ( on supported browser ) and Flash ( oldest browser ).

  • allows you to make HTTP requests to the Spreaker API in a very simple way (see Api calls)
  • allows you to make API calls on behalf of your website visitors (see Spreaker Connect)
  • allows you to listen any show or radio on Spreaker and building your own player (see Station Player)

Getting Started

Add the code to load the javascript library in your page:

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

         function onLoad() {
             // Add your code here ...

<body onload="onLoad()">

    <div id="sp-root"></div>
    <script type="text/javascript" src="http://static.spreaker.net/js/sdk_client.js"></script>


Please, note two requirements:
  1. You must add an empty div whose id is sp-root (we suggest you to put this code right before the closing </body> tag)
  2. You can use SP.* functions only after the ready dom event. This is because the sdk initializes itself and becomes ready to use only after the "ready" dom event (implementation provided by most javascript library). If you don't use any javascript library, you can register a callback on the body.onload event (see the example above).


To obtain information about the Javascript SDK, you only need to call the method SP.info()


{ version: "20110131-000"}