This project is a React Native application designed to demonstrate wallet functionality. It uses Vercel Serverless Functions to handle API requests and is configured to run on iOS, Android, and web platforms.
demo_video.mov
Ensure you have the following installed:
Requirement | Version |
---|---|
Node.js | >= 20 |
Xcode (for iOS) | >= 12 |
Android Studio | >= 4.0 |
(Optional) Vercel CLI | Used for hosting apple-app-site-association and assetlinks.json |
git clone git@github.com:tkhq/react-native-demo-wallet.git
cd react-native-demo-wallet
npm install
To start the application, use one of the following:
- iOS:
npm run dev
- Android:
npm run dev:android
- Web:
npm run dev:web
Install the Vercel CLI:
npm i -g vercel
Run the app locally:
vercel dev
Deploy the app:
vercel deploy
Script | Description |
---|---|
dev |
Starts the Expo server for iOS. |
dev:web |
Starts the Expo server for web. |
dev:android |
Starts the Expo server for Android. |
api |
Runs the Vercel development server. |
clean |
Removes the .expo and node_modules directories. |
postinstall |
Compiles Tailwind CSS for nativewind . |
This file contains the Expo app configuration:
name
: App nameslug
: URL-friendly app nameversion
: App versionorientation
: Screen orientationicon
: Path to app iconscheme
: Custom URL scheme for deep linkingplugins
: List of Expo plugins
Configures Expo Application Services (EAS) for app builds & submissions:
cli
: Specifies CLI versionbuild
: Contains build profiles (development, preview, production)submit
: App submission settings
Used for Android app linking:
relation
: Defines permissions for handling URLs & login credentialstarget
: Specifies the Android app package name & SHA-256 fingerprint
Used for iOS app linking:
webcredentials
: Lists apps that can access web credentials
Create a .env
file in the root directory of your project. You can use the provided .env.example
file as a template:
# ------------------------------
# SERVER-SIDE CONFIGURATION
# ------------------------------
TURNKEY_API_PUBLIC_KEY="<your_turnkey_api_public_key>"
TURNKEY_API_PRIVATE_KEY="<your_turnkey_api_private_key>"
# ------------------------------
# CLIENT-SIDE CONFIGURATION
# ------------------------------
## General App Info
EXPO_PASSKEY_APP_NAME="<your_app_name>"
EXPO_PUBLIC_RPID="<your_rpid_domain>"
EXPO_PUBLIC_BACKEND_API_URL="<your_backend_api_url>"
## Turnkey Configuration
EXPO_PUBLIC_TURNKEY_ORGANIZATION_ID="<your_turnkey_organization_id>"
EXPO_PUBLIC_TURNKEY_API_URL="https://api.turnkey.com"
## Google OAuth Credentials
EXPO_PUBLIC_GOOGLE_IOS_CLIENT_ID="<your_google_ios_client_id>"
EXPO_PUBLIC_GOOGLE_ANDROID_CLIENT_ID="<your_google_android_client_id>"
To allow passkeys to be registered on iOS and Android, you must set up an associated domain.
-
Host the
.well-known
file- Create an
apple-app-site-association
file (iOS) andassetlinks.json
file (Android). - Upload them to your server at:
https://your-domain.com/.well-known/apple-app-site-association https://your-domain.com/.well-known/assetlinks.json
- Create an
-
Update
app.json
for Expo
Modify the app.json
file to include the passkey domain:
{
"expo": {
"scheme": "myapp",
"ios": {
"associatedDomains": [
"webcredentials:your-domain.com",
"applinks:your-domain.com"
]
},
"android": {
"intentFilters": [
{
"action": "VIEW",
"category": ["BROWSABLE", "DEFAULT"],
"data": {
"scheme": "https",
"host": "your-domain.com"
}
}
]
}
}
}
- Set
EXPO_PUBLIC_RPID
in.env
EXPO_PUBLIC_RPID="<your_rpid_domain>"
-
Add Google credentials to
.env
GOOGLE_CLIENT_ID="your-google-client-id" GOOGLE_REDIRECT_SCHEME="your-google-redirect-scheme"
-
Modify
app.json
{
"expo": {
"scheme": "your-google-redirect-scheme"
}
}
To enable this feature, simply add the Sign in with Apple capability to your app in Xcode.