No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Salt Edge iOS Swift

A handful of classes to help you interact with the Salt Edge API from your iOS app.


iOS 10.0+, Swift 4+



Add the pod to your Podfile

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

Install the pod

$ pod install

Import SDK into your app

import SaltEdge

Connecting logins using the sample app

  1. Install dependencies by running $ pod install
  2. Replace the clientId, secret and customerIdentifier constants in AppDelegate.swift:49-51 with your Client ID and corresponding App secret
  3. Run the app

Note: You can find your Client ID and App secret at your secrets page.


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:
	    // Login successfully connected
    case .fetching:
	    // Login is fetching. You can safe login 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.createToken(params: tokenParams) { 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 (logins, transactions, accounts, et al.), for requesting login tokens for connecting, reconnecting and refreshing logins via a SEWebView, and also for connecting logins 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 Client 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 loginParams = SELoginParams(countryCode: "XF",
                                providerCode: "fakebank_simple_xf",
                                credentials: ["login": "username", "password": "secret"],
                                fetchType: "recent")
SERequestManager.shared.createLogin(with: loginParams) { response in
    switch response {
    case .success(let value):
	    // is a valid SELogin
    case .failure(let error):
    	// Handle error


There are some provided models for serializing the objects received in the API responses. These represent the providers, logins, 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 loginSecret: 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
  • SELogin
  • SEAccount
  • SETransaction
  • SETokenResponse
  • SEAttempt
  • 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 client ID, app secret, and a customer identifier. Set up the clientId, appSecret and customerIdentifier constants to your Client ID and corresponding App secret in AppDelegate.swift:49-51.


The current version of the SDK is 1.1.2, 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 LICENSE file.


  1. Salt Edge Connect Guide
  2. Salt Edge API Reference