Mobile SDK | Developers portal | Clay

Mobile SDK

Open doors with your mobile app, via Mobile Key functionality! The Clay mobile SDKs make it easy to build a seamless door opening experience in your application.

Decrease your app’s time to market with our out-of-box support for opening doors with your smartphone, natively inside your applications. Let’s save you some time, so you can work on the unique parts of your app that matter the most.

The CLP API offers two types of credentials: Tag & Mobile Key


A tag is a physical device (contactless key fob) that works based on RFID. Tags represent the user’s physical credentials to a lock. Every valid tag can lock and unlock a lock. RFID technologies available: DESfire, Mifare. 13.56MHz contactless RFID identification. High security, by using password and encrypted Proximity fobs.


A Mobile Key is the virtual equivalent of a Tag. The Mobile Key is stored on the user’s mobile device, and when presented to a lock, it uses BLE (Bluetooth Low Energy) to open the lock. This way users can use their smartphones as a Tag, opening the lock without relying on internet connection; which makes Mobile Key as secure as using a physical Tag.

Technical information

The brain of a Clay system is the IQ, it is the link between the lock and cloud. The IQ receives all changes and settings from your application and ensures that all locks are updated within seconds.
A Mobile Key is generated using encryption keys that are normally unique per IQ. It is however possible to synchronise these keys between the IQs that are part of a collection, so you can use the Mobile Key on locks that are attached to different IQs


– [x] Extract your apps Public Key for Communicating with the CLP API.
– [x] Use Mobile Key from the CLP API to open a lock.

show me content for:IOSANDROID


iOS 8.0+
Xcode 8.1, 8.2, 8.3, and 9.0
Swift 3.0, 3.1, 3.2, and 4.0


To start using the ClaySDK and the receive the Sample App, please contact us.


Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate ClaySDK into your Xcode project using Carthage, specify it in your Cartfile:

git “”

Run carthage update to build the framework and drag the built ClaySDK.framework, VirgilCrypto.framework and VirgilSDK.framework into your Xcode project.


If you prefer not to use any of the aforementioned dependency managers, you can integrate ClaySDK into your project manually.


First add the following frameworks from your Carthage folder to your xCode project:


Then, in your Targets Build Settings, set Enable Bitcode to NO.

To use:

// ‘self’ must conform to ClayDelegate
let clay = ClaySDK(delegate: self)
let publicKey = clay.getPublicKey()

// ‘yourOpenDoorDelegate’ must conform to OpenDoorDelegate
clay.openDoor(with: “your-encrypted-key”, delegate: yourOpenDoorDelegate)


Android SDK 14+
Android Studio 2.3 and above
Java 7 and above


First, you need to obtain a copy of the JustInMobile Android SDK from Salto . Once you have this copy, include into your libs folder of your app’s ‘app’ module. Make sure you include the contents of your ‘libs’ folder in your module’s dependencies.


Download the latest JAR or grab via Maven:


or Gradle:

compile ‘com.myclay.claysdk:claysdk:0.30.0’


If you prefer not to use any of the aforementioned dependency managers, you can integrate ClaySDK into your project manually.


To use:

IClaySDK claySDK = ClaySDK.init(context);
String publicKey = claySDK.getPublicKey()
String mkey = “<YOUR_MKEY>”;
try {
    claySDK.openDoor(mkey, new ILockDiscoveryCallback() {
        public void onPeripheralFound() {
          // handle the onPeripheralFound event
        public void onSuccess() {
          // handle the onSuccess event
        public void onFailure(ClayException exception) {
          // handle the onFailure event
} catch (ClayException e) {
      // handle the exception