Install via CocoaPods

In your Podfile, ensure the berbix-ios-spec Cocoapod spec repository is added to your sources and then add Berbix as one of your target dependencies.

target 'YourProject' do

  source ''
  source '[email protected]:berbix/berbix-ios-spec.git'

  pod 'Berbix', '3.0.4'

In addition to importing the Cocoapod dependency, you will also need to set the Privacy - Camera Usage Description in your Info.plist to enable camera access.


To initialize the Berbix Verify flow, refer to the code sample below and include your client_token in place of client_token_for_session. Please see our Integration Guide for more details on initializing the Berbix Verify flow and integrating Berbix APIs.

class ViewController : UIViewController, BerbixSDKDelegate {
    // This is hooked up to a button which starts the flow
    @IBAction func buttonPressed(_ sender: UIButton) {
        let berbixSDK = BerbixSDK()
        let config = BerbixConfigurationBuilder()
        berbixSDK.startFlow(self, delegate: self, config: config)

    func completed() {
        // Send request to server to fetch verification status
    func failed(error: BerbixError) {
        // Something went wrong in the execution of the flow


BerbixError Values

The following outlines the types of errors that could be returned in func failed(error: BerbixError). Some errors are non-recoverable and some may allow retrying the Berbix flow.

The user has canceled and quit the Berbix verification. This error can be retried and the user can either restart or resume their verification.

The user has denied camera permissions. Suggest to the user that they need to enable camera permissions in settings to be able to complete a Berbix verification.
NOTE: In new templates with a 2.0+ SDK, this error will not occur and the Verify flow will handle permission failure and fallback to file uploads.

The Berbix flow failed due to an internal error. This is most likely due to an issue on the Berbix backend. This error should be retry-able, and should be reported to Berbix support if it happens continuously.

The Berbix flow failed due to an unknown error. This is likely similar to the apiError and can be retried.

Demo App Source Code

A demo app source code is available here and can help with integration or environment setup.


BerbixSDK Methods


Constructs a Berbix SDK client. This can be used subsequently to invoke the Berbix flow within your app.

startFlow(_ vc: UIViewController, delegate: BerbixSDKDelegate, config: BerbixConfiguration)

Starts the Berbix flow and immediately takes control of the user interface. This is the most basic invocation of the flow. Upon completion of the flow, the user interface control will be returned to the app and the onComplete adapter method will be called. Upon any irrecoverable error, the onError adapter method will be called.

createSession(delegate: BerbixSDKDelegate, config: BerbixConfiguration, ready: @escaping () -> Void) -> BerbixSessionHandle

Creates a Berbix session but does not immediately take control of the user interface. When the session is created, ready will be run. At that point, the user interface can be rendered immediately by calling the associated display method. Returns a session handle that can be used to invoke the display method.

display(_ vc: UIViewController, handle: BerbixSessionHandle)

Takes immediate control of the user interface and begins the Berbix flow. This must be called in conjunction with createSession after the associated ready callback runs.

BerbixSDKConfigurationBuilder Methods


Creates a new options builder with the default initial state.

withClientToken(_ clientToken: String) -> BerbixConfigurationBuilder

Sets the client token for the session. This value is fetched from the Berbix API upon creation of a transaction.

© Berbix Inc. All rights reserved.