Kinvey Backbone 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 Backbone 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-backbone-sdk --save
or
bower install kinvey-backbone-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-backbone-sdk');
If you installed the SDK with bower, add a script tag to your main html file.
<script src="bower_components/kinvey-backbone-sdk/dist/kinvey-backbone-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 processnpm run lint
: lint the src filesnpm run build
: build the sdknpm 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:
- 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
- Open a terminal window.
- Change directory to the location of the project.
- Execute
npm run e2e:server
. Keep this terminal window open.
Start App
- Open a terminal window.
- Change directory to the location of the project.
- Execute
npm run e2e:app
. Keep this terminal window open.
Run End to End Tests
- Open a terminal window.
- Change directory to the location of the project.
- Execute
npm run e2e:test
.