How to Integrate
Getting Started with VGS Show iOS SDK
Before you start, you can also check VGSShowSDK GitHub Page, download Demo Application or browse the References.
Make sure that you check our best practices to ensure secure configurations.
How to Integrate the SDK
Quickstart from Dashboard
You should have your organization registered at the VGS Dashboard. Sandbox vault will be pre-created for you. You should use your vault id to start reveal data. Follow integration guide below.
Integrate VGSShowSDK into Your iOS Project
Step 1: Install the SDK
VGSShowSDK is distributed through CocoaPods and Swift Package Manager.
AI Agent Integration & Assisted Development
To accelerate your integration and ensure your implementation follows VGS best practices, you can use the AGENTS.md file as a context for AI Coding Agents. Attach or reference the URL to the AGENTS.md file to your agent's context: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/AGENTS.md.
Example System Prompt: "You are an autonomous engineering agent integrating the VGS Show iOS SDK into an existing Swift app. Use the contents of AGENTS.md as your authoritative policy.
Goals:
Add a screen revealing a user's details (card label, name label) using a single batched request.
Implement partial masking for the card.
Provide unit tests for the missing path.”
Integrate with CocoaPods
Install the latest version of CocoaPods. Go to Terminal and run the command:
If you don't have an existing Podfile in your project, go to your project folder and run the following command to create one:
And then open the file up in Xcode for editing:
Add VGSShowSDK pod to Podfile inside your project folder:
Back to your terminal window and run the following command to install VGSShowSDK:
Use the <your-app>.xcworkspace file to open your project in Xcode, instead of the .xcodeproj file, from here on out.
Update pods(optional)
If you installed VGSShowSDK before, you might need to update the SDK to the latest version. To do that run in terminal following command:
Integrate with Swift Package Manager
To use Swift Package Manager, in your Xcode project add the https://github.com/verygoodsecurity/vgs-show-ios.git repo. Follow the official Apple SPM Guide for more details.
Don't forget to import the module:
Next
Follow the integration guide to check the example how to create simple form for revealing credit cards data from your Vault.
Configure Your App
To initialize VGSShow you have to set your vault id and Environment type.
Configure UI Components
Create UI Form
Set content path
Set corresponding contentPath properties of VGSLabel instances. Each contentPath name should match key path in your reveal response object (JSON).
It is important to setup proper content path. - VGSShow cannot reveal data to subscribed views if content paths are not specified or set incorrectly.\
Use . to specify a multi-level nested content path.
Handle updates in VGSLabel
Implement VGSLabelDelegate to track changes in VGSShow views.
Request data
Use vgsShow.request(_:) to reveal data from subscribed VGS Show UI components. Update your app state in the request completion block.
To create test aliases, you can use VGS Collect SDK or check our code snippets.
As a result you should receive a successful response and see the revealed data in VGSLabel.
Error handling
When VGSShow can not reveal data for some subscribed views, it will reveal and display partially decoded data. If the response doesn't contain the key specified in the subscribed view contentPath VGSLabel delegate method labelRevealDataDidFail(_:) will be called. Implement VGSLabelDelegate protocol and set VGSLabel delegate. You can use labelRevealDataDidFail func to handle reveal errors.
See also:
Last updated

