Latest 2.1.0
License MIT
Platforms ios 10.0, osx 10.12
Dependencies TrustKit

Salt Edge iOS / macOS Swift SDK and iOS Example application

A handful of classes to help you interact with the Salt Edge API from your iOS / macOS app.
Last SDK version (2.1+) supports Salt Edge API v5.


  • iOS 10.0+ / macOS 10.12+
  • Swift 4+

Installation with CocoaPods

Add the pod to your Podfile

for Salt Edge API v5 use

pod 'SaltEdge-iOS-Swift', '~> 2.1.0'

for Salt Edge API v4 use

pod 'SaltEdge-iOS-Swift', '~> 1.1.2'

Install the pod

$ pod install

Import SDK into your app

import SaltEdge

Init SDK

Replace the appId, appSecret and customerId constants in AppDelegate.swift:49-51

Note: You can find your appId and appSecret in at your secrets page. customerId – it is the unique identifier of the new customer.


A small WKWebView subclass for using Salt Edge Connect within your iOS app.


Let your view controller conform to the SEWebViewDelegate protocol.

class MyViewController : UIViewController, SEWebViewDelegate {
  // ... snip ...

Instantiate a SEWebView and add it to the controller:

let connectWebView = SEWebView(frame: self.view.bounds)
connectWebView.stateDelegate = self

Implement the SEWebViewDelegate methods in the controller:

// ... snip ...

func webView(_ webView: SEWebView, didReceiveCallbackWithResponse response: SEConnectResponse) {
    switch response.stage {
    case .success:
        // Connection successfully connected
    case .fetching:
        // Connection is fetching. You can safe connection secret if it is present.
    case .error:
        // Handle error

func webView(_ webView: SEWebView, didReceiveCallbackWithError error: Error) {
    // Handle error

Load the Salt Edge Connect URL into the web view and you’re good to go:

SERequestManager.shared.createConnectSession(params: connectSessionParams) { response in
    switch response {
    case .success(let value):
        if let url = URL(string: {
            self.webView.load(URLRequest(url: url))
    case .failure(let error):
        // Handle error


A class designed with convenience methods for interacting with and querying the Salt Edge API. Contains methods for fetching entities (Connections, Transactions, Accounts, et al.), for requesting connect url for connecting, reconnecting and refreshing Connections via a SEWebView, and also for connecting Connections via the REST API.

Each successful request via SEAPIRequestManager returns SEResponse containing data and meta.

Each failed request returns standard Swift’s Error .


Link your App ID and App Secret in the first place before using it.

SERequestManager.shared.set(appId: appId, appSecret: appSecret)


let params = SECustomerParams(identifier: "your-customer-unique-id")
SERequestManager.shared.createCustomer(with: params) { response in
    switch response {
    case .success(let value):
        // Save customer secret to your storage and the link it with API manager
    case .failure(let error):
        // Handle error

Use the manager to interact with the provided API:

let connectionParams = SEConnectionParams(
    consent: SEConsent(scopes: ["account_details", "transactions_details"]),
    countryCode: "XF",
    providerCode: "fakebank_simple_xf",
    credentials: ["login": "username", "password": "secret"]
SERequestManager.shared.createConnection(with: connectionParams) { response in
    switch response {
    case .success(let value):
        // is a valid SEConnection
    case .failure(let error):
        // Handle error


There are some provided models for serializing the objects received in the API responses. These represent the Providers, Connections, Accounts, Transactions, provider fields and their options. Whenever you request a resource that returns one of these types, they will always get serialized into Swift structs. For instance, the getAllTransactions(for connectionSecret: String, params: SETransactionParams? = nil, completion: SEHTTPResponse<[SETransaction]>) method has a SEResponse containing data and meta where data is [SETransaction] in it’s success callback.

Models contained within the components:

  • SEProvider
  • SEConnection
  • SEAccount
  • SETransaction
  • SEConnectSessionResponse
  • SEAttempt
  • SEConsent
  • SECountry
  • SECustomer
  • SEStage
  • SEError
  • SEProviderField
  • SEProviderFieldOption

For a supplementary description of the models listed above that is not included in the sources’ docs, feel free to visit the API Reference.


Documentation is available for all of the components. Use quick documentation (Alt+Click) to get a quick glance at the documentation for a method or a property.

Running the demo

To run the demo app contained in here, you have to provide the demo with your App ID, App Secret, and a customer identifier.
Set up the appId, appSecret and customerId constants to your App ID and corresponding App Secret in AppDelegate.swift:49-51.


The current version of the SDK is 2.1.0, and supports the latest available version of Salt Edge API. Any backward-incompatible changes in the API will result in changes to the SDK.


The SDK has SSL pinning enabled. That means that every API request that originates in SEAPIRequestManager will have SSL certificate validation.

Since version 1.1.0

The SDK has moved to HTTP Public Key Pinning (HPKP)


See the Changelog file.


See the LICENSE file.


  1. Salt Edge API General
  2. Salt Edge Client Dashboard
  3. Salt Edge API v5 Reference

Latest podspec

    "name": "SaltEdge-iOS-Swift",
    "version": "2.1.0",
    "summary": "A handful of classes to help you interact with the Salt Edge API from your iOS or macOS app.",
    "description": "SaltEdge-iOS is a library targeted at easing the interaction with the [Salt Edge API]( library aims to come in handy with some core API requests such as connecting a connection, fetching accounts/transactions, et al.",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": "SaltEdge",
    "source": {
        "git": "",
        "tag": "2.1.0"
    "platforms": {
        "ios": "10.0",
        "osx": "10.12"
    "module_name": "SaltEdge",
    "dependencies": {
        "TrustKit": []
    "source_files": "saltedge-ios-swift/Classes/**/*"

Pin It on Pinterest

Share This