npm install ibmcloudcodeMobile Cloud Services JavaScript SDK for cloud code
===
ATTENTION: This service is currently deprecated on Bluemix and will be completely removed shortly. Please use the 2nd generation of Bluemix MobileFirst Services.
This package contains the required native components to interact with the IBM Mobile Cloud Services for Bluemix. You can use the JavaScript SDK to build Web or Hybrid applications. You can also use this SDK in server-side Node.js
JavaScript modules. The SDK manages all the communication and security integration between
the client and the Mobile Cloud Services in Bluemix.
When you use Bluemix to create a Mobile Cloud application, BlueMix provisions multiple services under a single application context. Your mobile application is given access to the following mobile services: Mobile Application Security, Push, and Mobile Data.
Version: v1.0.0-20160421-1718
##Install the SDK
You can install the SDK:
* By installing the individual components with Bower or NPM. Use these tools to shorten the startup time for new projects and lessen the burden of managing library version requirements and dependencies. If you
are using one of the Mobile Cloud samples,
instructions for using the package manager is included with the documentation.
* By downloading a zip file.
ibmcloudcode package:
bash
npm install ibmcloudcode
`
$3
To install Bower, go to Download Bower.
Run the following command to install the ibmcloudcode package:
`
bower install https://hub.jazz.net/git/bluemixmobilesdk/ibmcloudcode-javascript/.git
`
###Download zip file
To download a zip of the entire SDK, see Building Mobile Cloud applications.
###Contents
The complete SDK consists of a core, plus a collection of modules that correspond to function exposed
by the Mobile Cloud Services. The downloaded zip file
contains all of them. However, each piece of the JavaScript SDK is also available as a separate module
that you can add to your project individually. This allows maximum flexibility, as the developer is able to
pick and choose the modules required for a given application.
The JavaScript SDK contains the following components, any of which may be added to your project.
- ibmbluemix - This is the foundation of the SDK and controls connection and communication with Backend services
- ibmpush - This is the service SDK for push notification support
- ibmdata - This is the service SDK for cloud data storage
- ibmcloudcode - This is the service SDK for cloud code invocation
##Get started
Services are associated with a Mobile Cloud application. Connectivity and interaction with
these services depends on the application ID, application secret, and application route associated
with a Mobile Cloud Application.
The cloud code JavaScript SDK for IBM Bluemix can be used in a Web or Hybrid application. You
can also use the SDK inside a server-side Node.js JavaScript module.
Cloud code provides easy access to the cloud hosted logic and static resources in your Bluemix Mobile
Cloud application.
An example of initializing the Mobile Cloud Services SDK and cloud code follows.
`javascript
var config = {
applicationId:"",
applicationRoute:"",
applicationSecret:""
};
IBMBluemix.initialize(config);
var cc = IBMCloudCode.initializeService();
``