JSPM

  • Created
  • Published
  • Downloads 19
  • Score
    100M100P100Q68840F
  • License Apache-2.0

Kinvey JavaScript SDK for HTML5.

Package Exports

  • kinvey-html5-sdk
  • kinvey-html5-sdk/dist/device
  • kinvey-html5-sdk/dist/export
  • kinvey-html5-sdk/dist/kinvey
  • kinvey-html5-sdk/dist/popup

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (kinvey-html5-sdk) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Kinvey HTML5 SDK

Kinvey (pronounced Kin-vey, like convey) makes it ridiculously easy for developers to setup, use and operate a cloud backend for their mobile apps. They don't have to worry about connecting to various cloud services, setting up servers for their backend, or maintaining and scaling them.

This node and bower module makes it very easy to connect your Html5 app with Kinvey.

How to use

1. Sign up for Kinvey

To use the SDK, sign up for Kinvey if you have not already done so. Go to the sign up page, and follow the steps provided.

2. Install the SDK

You can install the module using npm:

npm install kinvey-html5-sdk --save

or

bower install kinvey-html5-sdk --save

3. Configure the SDK

If you installed the SDK with npm, import the sdk in your code using require.

var Kinvey = require('kinvey-html5-sdk');

If you installed the SDK with bower, add a script tag to your main html file.

<script src="bower_components/kinvey-html5-sdk/dist/kinvey-html5-sdk.min.js"></script>

Next, use Kinvey.init to configure your app. Replace <appKey> and <appSecret> with your apps app key and secret. You can find these for your app using the Kinvey Console App.

Kinvey.init({
    appKey: '<appKey>',
    appSecret: '<appSecret>'
});

4. Verify Set Up

You can use the following snippet to verify the app credentials were entered correctly. This function will contact the backend and verify that the SDK can communicate with your app.

Kinvey.ping().then(function(response) {
  console.log('Kinvey Ping Success. Kinvey Service is alive, version: ' + response.version + ', response: ' + response.kinvey);
}).catch(function(error) {
  console.log('Kinvey Ping Failed. Response: ' + error.message);
});

What’s next?

You are now ready to start building your awesome apps! Next we recommend diving into the User guide or Data store guide to learn more about our service, or explore the sample apps to go straight to working projects.

Tasks

Note: Before running any tasks you will need to run npm install to install any dependencies required.

  • npm run clean: remove files created by the build process
  • npm run lint: lint the src files
  • npm run build: build the sdk
  • npm run bundle: bundle the sdk for dist

Test

Note: Before running any tests you will need to run npm install to install any dependencies required.

Unit Tests

The steps for running the unit tests is as follows:

  1. Open a terminal window and execute npm test.

End to End Tests

The steps for running the end to end tests is as follows:

Start Selenium Web Server

  1. Open a terminal window.
  2. Change directory to the location of the project.
  3. Execute npm run e2e:server. Keep this terminal window open.

Start App

  1. Open a terminal window.
  2. Change directory to the location of the project.
  3. Execute npm run e2e:app. Keep this terminal window open.

Run End to End Tests

  1. Open a terminal window.
  2. Change directory to the location of the project.
  3. Execute npm run e2e:test.