> For the complete documentation index, see [llms.txt](https://docs.human-id.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.human-id.org/ios-sdk-integration-guide.md).

# iOS SDK Integration Guide

## **Overview**

1. [Requirements](/ios-sdk-integration-guide.md#requirements)
2. [Steps](/ios-sdk-integration-guide.md#steps)
3. [Sample](/ios-sdk-integration-guide.md#sample)

## Requirements

* Xcode 11.4+
* Swift 5.0
* iOS 11.0+

Please update to the latest SDK!

## Steps

1. [Installation](/ios-sdk-integration-guide.md#1-installation)
2. [Get Credentials](/ios-sdk-integration-guide.md#2-get-credentials)
3. [Configuration](/ios-sdk-integration-guide.md#3-configuration)
4. [Using the iOS SDK](/ios-sdk-integration-guide.md#4-using-the-ios-sdk)

### 1. Installation

The humanID SDK is available through [CocoaPods](https://cocoapods.org/pods/HumanIDSDK).\
To install it, simply add the following line to your Podfile:

```
pod 'HumanIDSDK'
```

### **2. Get Credentials**

Get the clientID and clientSecret through the [App Registration Form](https://developers.human-id.org/home/).

### **3. Configuration**

Add this code to your AppDelegate.swift and make sure all the values are fulfilled.

```bash
import HumanIDSDK

           @UIApplicationMain
           class AppDelegate: UIResponder, UIApplicationDelegate {

             func application(_ application: UIApplication, didFinishLaunchingWithOptions 
launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
                HumanIDSDK.shared.configure(clientID: "YOUR_CLIENT_ID", clientSecret: 
"YOUR_CLIENT_SECRET")
             }
           }
```

### 4. Using the iOS SDK

Add this code to your ViewController file. We recommend you wrap this in a function that handles the login button.

```bash
import HumanIDSDK

           class YourViewController: UIViewController {

           @IBAction func yourLoginAction(_ sender: Any) {
               HumanIDSDK.shared.requestOtp(view: self, name: "YOUR_APPLICATION_NAME", image: "YOUR_APPLICATION_LOGO")
               }
           }

           extension YourViewController: RequestOTPDelegate {

           func login(with token: String) {
               // TODO You can persist our token here.
               }
           }
```

### 5. You Are All Set!

Your iOS app should now be integrated with the humanID login.

## Sample

See our Github for a full [sample](https://github.com/human-internet/humanid-ios-sdk/tree/master/Example) to learn more!

* **Warning!** To run the example project, clone the repo, and run pod install from the Example directory first.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.human-id.org/ios-sdk-integration-guide.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
