---
page_title: 1. Getting SDK
product: Hypercheckout
platform: iOS
page_source: https://juspay.io/in/docs/hyper-checkout/ios/base-sdk-integration/1-getting-sdk
llms_txt: https://juspay.io/in/docs/llms.txt
product_llms_txt: https://juspay.io/in/docs/hyper-checkout/llms.txt
---


# 1. Getting the SDK



To integrate HyperCheckout into your iOS application, install and configure the HyperSDK using either **Swift Package Manager (SPM)**  or **CocoaPods.** This guide covers both package managers. 

Installation involves two steps regardless of the package manager:

1. Install the Assets Plugin.
2. Install the HyperCheckout SDK.


---



## **Choose your package manager** 



1. **[CocoaPods](https://juspay.io/in/docs/hyper-checkout/ios/base-sdk-integration/1-getting-sdk#Install-using-CocoaPods-Manager)**
   Ruby-based dependency manager for Xcode projects.

2. **[Swift Package Manager](https://juspay.io/in/docs/hyper-checkout/ios/base-sdk-integration/1-getting-sdk#Install-using-Swift-Package-Manager)**
   Apple's built-in dependency manager for Xcode projects.




---



## **Install using CocoaPods Manager** 




### **1. Install the Assets Plugin** 



HyperSDK relies on assets delivered over the air and must be present at build time. The Assets Plugin downloads these assets and ensures the latest versions are available on every build. To install the Assets Plugin, complete two sub-steps:


### Step 1.1 Add Post Install Script to Podfile


This Ruby Script will download all the latest assets required for proper functioning of your HyperCheckout integration



#### Code Snippets: -

#### Swift Code Snippet:

```swift
use_frameworks!


target 'juspay-sdk-integration-swift' do
  # Adding Hyper SDK dependecy
  # block:start:adding-hyper-sdk-pod
  pod 'HyperSDK', '2.1.31'
  # block:end:adding-hyper-sdk-pod
end


# Adding Hyper SDK dependecy
# block:start:adding-plugin-installation-script
post_install do |installer|
 fuse_path = "./Pods/HyperSDK/Fuse.rb"
 clean_assets = true # Pass true to re-download all the assets
 if File.exist?(fuse_path)
   if system("ruby", fuse_path.to_s, clean_assets.to_s)
   end
 end
end
# block:end:adding-plugin-installation-script

```

#### ObjectiveC Code Snippet:

```objectivec
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

use_frameworks!


target 'ObjectiveC' do
  # Adding Hyper SDK dependecy
  # block:start:adding-hyper-sdk-pod
  pod 'HyperSDK', '2.1.31'
  # block:end:adding-hyper-sdk-pod
end


# Adding Hyper SDK dependecy
# block:start:adding-plugin-installation-script
post_install do |installer|
 fuse_path = "./Pods/HyperSDK/Fuse.rb"
 clean_assets = false # Pass true to re-download all the assets
 if File.exist?(fuse_path)
   if system("ruby", fuse_path.to_s, clean_assets.to_s)
   end
 end
end
# block:end:adding-plugin-installation-script

```



### Step 1.2 Add MerchantConfig.json


The `MerchantConfig.json` file contains the client IDs used by the Assets Plugin to download assets specific to your application.

1. Create a file named `MerchantConfig.json`.
2. Place the file in the root directory of your project.
3. Add your client configuration details.


#### Merchant Configuration Code Snippet:

```merchant configuration
Sample:
{
  "clientConfigs": {
	"your-client-id": {}
  }
}
```





### **2. Install the HyperSDK** 



For using the services provided by the HyperCheckout SDK, client needs to implement certain APls exposed by the SDK. These APls are available through the HyperCheckout SDK. It is a build time dependency which exposes certain classes for use across your application.

To install the HyperCheckout SDK follow the below steps:


### Step 2.1 Add SDK dependency to Podfile


Hyper SDK is served via cocoa pods. In order to download and install the same to your application please add Hyper SDK pod to your pod file.



#### Code Snippets: -

#### Swift Code Snippet:

```swift
use_frameworks!


target 'juspay-sdk-integration-swift' do
  # Adding Hyper SDK dependecy
  # block:start:adding-hyper-sdk-pod
  pod 'HyperSDK', '2.1.31'
  # block:end:adding-hyper-sdk-pod
end


# Adding Hyper SDK dependecy
# block:start:adding-plugin-installation-script
post_install do |installer|
 fuse_path = "./Pods/HyperSDK/Fuse.rb"
 clean_assets = true # Pass true to re-download all the assets
 if File.exist?(fuse_path)
   if system("ruby", fuse_path.to_s, clean_assets.to_s)
   end
 end
end
# block:end:adding-plugin-installation-script

```

#### ObjectiveC Code Snippet:

```objectivec
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

use_frameworks!


target 'ObjectiveC' do
  # Adding Hyper SDK dependecy
  # block:start:adding-hyper-sdk-pod
  pod 'HyperSDK', '2.1.31'
  # block:end:adding-hyper-sdk-pod
end


# Adding Hyper SDK dependecy
# block:start:adding-plugin-installation-script
post_install do |installer|
 fuse_path = "./Pods/HyperSDK/Fuse.rb"
 clean_assets = false # Pass true to re-download all the assets
 if File.exist?(fuse_path)
   if system("ruby", fuse_path.to_s, clean_assets.to_s)
   end
 end
end
# block:end:adding-plugin-installation-script

```



### Step 2.1 Install Podfile


After updating your Podfile, run the following commands from your project's root directory:


#### Terminal Code Snippet:

```terminal
pod repo update
pod install
```


On a successful install, the `pod install` output includes lines similar to the following:


#### Terminal Output Code Snippet:

```terminal output
[HyperSDK] Client ID - your-client-id
[HyperSDK] Downloading assets...
[HyperSDK] XX file(s) downloaded/updated.
[HyperSDK] Adding the required URL Schemes & Queries Schemes in plist files
[HyperSDK] Plist file path: ./{Project Name}/Info.plist
[HyperSDK] Done.
```


Note: <your-client-id> is the clientId shared by the Juspay team. Do not use internalPP.




## **Install using Swift Package Manager** 




### 1. Install the Assets Plugin.



HyperSDK relies on assets delivered over the air and must be present at build time. The Assets Plugin downloads these assets and ensures the latest versions are available on every build. To install the Assets Plugin, complete two sub-steps:


### Step 1.1. Configure the asset download script.


* In Xcode, navigate to: **Product → Scheme → Edit Scheme**
* Alternatively, select your target from the scheme dropdown in the Xcode toolbar and click **Edit Scheme** .
* Add a Build Pre-action in the Scheme Editor:
  
  * Expand **Build →** Select **Pre-actions →** Click **+**  and choose **New Run Script Action**
* Select Build Settings Provider
  
  Select the application target for **Provide build settings from**
* Add and run the following Script
  
  
  #### Pre-built action script Code Snippet:
  
  ```pre-built action script
  PACKAGE_DIR="${BUILD_DIR%Build/*}SourcePackages/artifacts/hypersdk-ios/HyperSDK"
  XCFRAMEWORK_DIR="${PACKAGE_DIR}/HyperSDK.xcframework"
  FUSE_SCRIPT="${PACKAGE_DIR}/Fuse.rb"
  FUSE_MARKER="${XCFRAMEWORK_DIR}/.fuse_completed"
  VALIDATION_SCRIPT="${PACKAGE_DIR}/ValidateHyperSDK.rb"
  
  [ ! -f "$FUSE_MARKER" ] || [ "${ACTION}" == "clean" ] && { cd "${PROJECT_DIR}"; echo "Running Fuse.rb script..."; ruby "$FUSE_SCRIPT"; }
  
  ruby "$VALIDATION_SCRIPT" && touch "$FUSE_MARKER" || exit 1
  ```

> **Note**
> This script is executed whenever you perform a **Clean Build Folder**  operation. It validates the SDK installation, updates required configurations, and ensures the latest assets are available






### Step 1.2 Add MerchantConfig.json


The `MerchantConfig.json` file contains the client IDs used by the Assets Plugin to download assets specific to your application.

1. Create a file named `MerchantConfig.json`.
2. Place the file in the root directory of your project.
3. Add your client configuration details.


#### Merchant Configuration Code Snippet:

```merchant configuration
Sample:
{
  "clientConfigs": {
	"your-client-id": {}
  }
}
```





### **2. Install the HyperSDK** 



For using the services provided by the HyperCheckout SDK, client needs to implement certain APls exposed by the SDK. These APls are available through the HyperCheckout SDK. It is a build time dependency which exposes certain classes for use across your application.

To install the HyperCheckout SDK follow the below steps:


### Step 2.1 Add the SDK dependency


You can add the SDK package dependency directly through Xcode:

1. Navigate to File → Add Package Dependencies...
2. Enter the repository URL: [https://github.com/juspay/hypersdk-ios.git](https://github.com/juspay/hypersdk-ios.git)
3. Under Dependency Rule, change the dropdown from _Branch_  to Exact Version and input the specific version number provided to you by Juspay.
4. Select your app target and click Add Package.




### Step 2.2 Do Clean Build Folder


This will download all the latest assets required for proper functioning of HyperSDK. You can see this output in Clean Build report logs:


#### Clean Build report Code Snippet:

```clean build report
[HyperSDK] HyperSDK version - 2.2.3
[HyperSDK] (your-client-id) Downloading assets from: https://public.releases.juspay.in/hyper/bundles/in.juspay.merchants/\<clientId>/ios/release/assets.zip
[HyperSDK] (your-client-id) Download complete!
[HyperSDK] (your-client-id) Extracting assets...
[HyperSDK] Adding the required URL Schemes & Queries Schemes in plist files...
[HyperSDK] Plist file path: HyperPPDemo/Info.plist
[HyperSDK] Done.
```




---

## Complete Code Reference

The following code files are referenced in the steps above:

### Podfile

```
use_frameworks!


target 'juspay-sdk-integration-swift' do
  # Adding Hyper SDK dependecy
  # block:start:adding-hyper-sdk-pod
  pod 'HyperSDK', '2.1.31'
  # block:end:adding-hyper-sdk-pod
end


# Adding Hyper SDK dependecy
# block:start:adding-plugin-installation-script
post_install do |installer|
 fuse_path = "./Pods/HyperSDK/Fuse.rb"
 clean_assets = true # Pass true to re-download all the assets
 if File.exist?(fuse_path)
   if system("ruby", fuse_path.to_s, clean_assets.to_s)
   end
 end
end
# block:end:adding-plugin-installation-script

```

### Podfile

```
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

use_frameworks!


target 'ObjectiveC' do
  # Adding Hyper SDK dependecy
  # block:start:adding-hyper-sdk-pod
  pod 'HyperSDK', '2.1.31'
  # block:end:adding-hyper-sdk-pod
end


# Adding Hyper SDK dependecy
# block:start:adding-plugin-installation-script
post_install do |installer|
 fuse_path = "./Pods/HyperSDK/Fuse.rb"
 clean_assets = false # Pass true to re-download all the assets
 if File.exist?(fuse_path)
   if system("ruby", fuse_path.to_s, clean_assets.to_s)
   end
 end
end
# block:end:adding-plugin-installation-script

```


---

## See Also

- [Webhooks](https://juspay.io/in/docs/hyper-checkout/ios/base-sdk-integration/webhooks)
- [2. Initialize SDK](https://juspay.io/in/docs/hyper-checkout/ios/base-sdk-integration/initiating-sdk)
