Getting Started

The content in this guide refers to the newly released version 3 of the library. You can still access the version 1.x guides here.

Version 1.x is now deprecated. We will continue to support 1.x through March 31, 2017 (End of Support - EOS). If you are currently using 1.x in your apps, you will need to upgrade your apps to 3.x before the EOS date. We have created a migration guide to help you.

This guide walks you through setting up your app with Kinvey.


  • Xcode 8.1 or above.
  • iOS 9 or above.
  • Swift 2.3 or above. Refer to the download page for the Kinvey version that matches your preferred Swift version.

Setup Kinvey

You can start using the Kinvey framework in one of three ways - using CocoaPods, using the Kinvey starter app, or using the SDK source code.

Using CocoaPods

If you are using CocoaPods, add the Kinvey Pod to your target in the Podfile.

pod `Kinvey`

For a target called MyProject, your Podfile will look like this:

target 'MyProject' do

  pod 'Kinvey'


From the Terminal, run pod install in the project folder to install the dependency.

If you are using Swift 2.3, you will need to use Kinvey version 3.2.x.

pod 'Kinvey', '~> 3.2.1'

Using the Starter App

You can get started with the Kinvey iOS starter app. The starter app is bundled with the Kinvey framework.

We recommend updating the Kinvey framework in the app to the latest available on our downloads page before you begin.

Using SDK Source Code

The Kinvey iOS SDK is open source. If you prefer to compile your app against the SDK source code, you can follow the instructions on our github repo to set up the SDK.

Initialize Kinvey Client

Before you can communicate with the backend, you need to give the library your app key and secret. This is done with the following code snippet, substituting your app's key and secret (found in the management console header when viewing your app backend). We recommend adding this to your AppDelegate's application:didFinishLaunchingWithOptions: method.

import Kinvey

    appKey: "<#Your app key#>",
    appSecret: "<#Your app secret#>"

Customers with dedicated Kinvey instances will need to set the apiHostname to your dedicated Kinvey host URL.

You can find the host URL in your console dashboard, next to your App Key and App Secret.

//Set the apiHostName to a sample url.
//Replace the sample url with the url for your dedicated Kinvey backend.
    appKey: "<#Your app key#>",
    appSecret: "<#Your app secret#>",
    apiHostName: NSURL(string: "<#>")!
//Set the apiHostName to a sample url.
//Replace the sample url with the url of your dedicated Kinvey backend.
    appKey: "<#Your app key#>",
    appSecret: "<#Your app secret#>",
    apiHostName: URL(string: "<#>")!

Verify Set Up

You can use to verify that the app credentials were entered correctly. This function will contact the backend and verify that the library can communicate with your app. This code can be placed in your UIApplicationDelegate.application(_, didFinishLaunchingWithOptions:) method after the Client.initialize(). This function is good for while-in-development sanity check, but we do not recommend using it as part of a production application. The ping method is a not a robust way to test that the service is available. { (result: Result<EnvironmentInfo, Swift.Error>) in
    switch result {
    case .success(let envInfo):
    case .failure(let error):

Every App has an Active User

Your app will be used by a real-life human being. This person is represented by the Active User. This user object must explicitly be created, either with a username and password, OAuth sign-on (such as Facebook, Google+, LinkedIn, etc.), or Mobile Identity Connect. See the User Guide for more information.

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.

Got a question?