You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Swift Demo Wallet is a sample iOS/macOS application that demonstrates how to build a simple wallet experience using Turnkey infrastructure. It showcases session handling, wallet creation/import, and transaction signing in a native SwiftUI application.
3
+
A minimal iOS/macOS application demonstrating how to build an embedded wallet experience using Turnkey infrastructureand Auth Proxy.
4
4
5
-
---
5
+
## What this demo shows
6
6
7
-
## Quick Start
7
+
A high-level summary of the user experience and what you can see on screen:
8
8
9
-
### 1. Clone the Repository
9
+
-**Authentication**: Log in with passkeys, OTP (email/SMS), or OAuth (Google, Apple, Discord, X)
10
+
-**Session Management**: Automatic session handling with secure key storage in Secure Enclave
11
+
-**Wallet Operations**: Create, import, and export wallets with mnemonic phrases
12
+
-**Message Signing**: Sign messages and raw payloads with wallet accounts
13
+
-**User Management**: Update email/phone and view wallet details
10
14
11
-
```
15
+
## Getting started
16
+
17
+
### 1/ Cloning the example
18
+
19
+
Make sure you have Xcode 15+ installed.
20
+
21
+
```bash
12
22
git clone https://github.com/tkhq/swift-sdk
13
-
cd Examples/swift-demo-wallet
23
+
cdswift-sdk/Examples/swift-demo-wallet
14
24
```
15
25
16
-
### 2. Open the Project
26
+
### 2/ Setting up Turnkey
17
27
18
-
Open the `Examples/swift-demo-wallet` folder and build the project in Xcode.
28
+
1. Set up your Turnkey organization and account. You'll need your **parent organization ID**.
29
+
2. Enable **Auth Proxy** from your Turnkey dashboard:
30
+
- Choose the user auth methods (Email OTP, SMS OTP, OAuth providers)
31
+
- Configure redirect URLs for OAuth (if using)
32
+
- Copy your **Auth Proxy Config ID** for the next step
33
+
3. (Optional) For passkey authentication, set up your **RP ID** domain with associated domains
19
34
20
-
### 3. Configure Constants
35
+
### 3/ Configure Constants
21
36
22
-
Edit `Helpers/Constants.swift` and fill in the required values:
37
+
Edit `swift-demo-wallet/Helpers/Constants.swift` and add your values:
23
38
24
39
```swift
25
40
enumConstants {
26
41
enumApp {
27
42
staticlet appName ="Swift Demo Wallet App"
28
-
staticlet rpId ="<your_rp_id>"// e.g. passkeyapp.tkhqlabs.xyz
29
-
staticlet backendBaseUrl ="<your_backend_url>"// e.g. http://localhost:3000
43
+
staticlet rpId ="<your_rp_id>"// required for passkeys
Turnkey requires authentication requests (sign-up/login) to be validated (stamped) using your root user API key-pair. Since this key-pair must remain private, it cannot be used directly in the frontend. Instead, authentication requests must be processed and stamped through a backend server before being forwarded to Turnkey.
61
-
62
-
### 1. Configure Environment Variables
63
-
64
-
Create a `.env` file inside the `example-server` folder:
0 commit comments