Getting Started with Java Script/HTML5

Register and Create App

Here are the steps you need to follow in order to get started with the App42 platform

  • Register with the App42 platform.
  • Create an App once you are on Quick-start page (after registration)
  • If you are already registered, login to the AppHQ console and create an App from the App Manager -> Create App link
  • Once the App is created, you will get an ApiKey/SecretKey that you will use in your app for initialization of the SDK.
Download and Set up SDK
  • Download Java Script SDK
  • Unzip the downloaded Zip file, the Unzip file contains a sample folder and App42-all-x.x.x.min.js file.
  • Include the following script statement in the HTML page of your project
   <script type="text/javascript" src="App42-all-x.x.x.min.js" />
Initialize SDK

You have to instantiate ServiceAPI class and pass your ApiKey/SecretKey to initialize the SDK.

   App42.initialize("YOUR_API_KEY","YOUR_SECRET_KEY");
Using App42 Services

Once you have initialized your SDK with the API Key/SecretKey you have to the build target service that you want to use in your app. For example, User Service can be built with following snippet. You can build the other services in a similar manner. Want to know about all the services of App42 Platform? Click Here

//Build User Service
var userService  = new App42User();
// Using userService reference, you should be able to call all its method like create user/update user/authenticate etc.
//Build Storage Service
var storageService  = new App42Storage();
// Using storageService reference, you should be able to call all its method like insert/save/update/delete etc for JSON objects.
//Similarly you can build other services like new App42XXXX()

Go To Creating App User for learning App User Management

OR

Go To Saving App Data to learn about App Data Storage.