Skip to content

Commit

Permalink
docs(sdk): React native passkeys tutorial (#663)
Browse files Browse the repository at this point in the history
* Write tutorial

* Upload GIF

* Some improvements

* Update image

* Vale

* Some improvements

* Some improvements

* Some fixes and improvements

* Update pages/advanced/passkeys/tutorials/react-native.mdx

* Update pages/advanced/passkeys/tutorials/react-native.mdx

* Update pages/advanced/passkeys/tutorials/react-native.mdx

* Update pages/advanced/passkeys/tutorials/react-native.mdx

* Update pages/advanced/passkeys/tutorials/react-native.mdx

* Update pages/advanced/passkeys/tutorials/react-native.mdx

* Update pages/advanced/passkeys/tutorials/react-native.mdx

* Add react-native-passkeys tutorial to generateCodeExamples.js script

* Switch generateCodeExamples.js to TypeScript

* Run generateCodeExamples.ts

* Add Xcode to Vale whitelist

* Import style changes from tutorial repo

* Implement requested changes

* Implement requested changes

* Fix vale errors

* Revert requested change l.93 and fix formatting issue

* Fix instructions for iOS

* Reupload iOS assets

* Fix typo

* Add app.json to the code examples

* Streamline iOS flow; implement requested changes

* Fix typo

---------

Co-authored-by: louis-md <[email protected]>
  • Loading branch information
yagopv and louis-md authored Jan 16, 2025
1 parent da55547 commit 95f09c0
Show file tree
Hide file tree
Showing 16 changed files with 976 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
const fs = require('fs')

type Repo = {
organization: string
repo: string
destination: string
branch: string
files: string[]
}

const repos = [
{
organization: '5afe',
Expand Down Expand Up @@ -35,6 +43,20 @@ const repos = [
'/layouts/default.vue',
'/nuxt.config.ts'
]
},
{
organization: '5afe',
repo: 'react-native-passkeys-tutorial',
destination: './examples/react-native-passkeys',
branch: 'main',
files: [
'/lib/passkeys.ts',
'/lib/safe.ts',
'/lib/storage.ts',
'/App.tsx',
'/app.json',
'/.env-sample'
]
}
// {
// organization: '5afe',
Expand All @@ -59,7 +81,7 @@ const generateCodeExamples = async ({
branch,
destination,
files
}) => {
}: Repo) => {
const fetch = await import('node-fetch')
files.forEach(async filePath => {
const url = `https://raw.githubusercontent.com/${organization}/${repo}/${branch}${filePath}?token=$(date +%s)`
Expand Down
7 changes: 6 additions & 1 deletion .github/styles/config/vocabularies/default/accept.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@
[Tt]estnet
[Tt]rezor
[Vv]alidator
[Ww]hitepaper
[Ww]hitepaper
[Xx]code
A1
AA
ABI
Expand Down Expand Up @@ -150,6 +151,7 @@ Katla
Klaytn
Kovan
Kroma
keystore
LUKSO
Lightlink
Lisk
Expand All @@ -167,6 +169,7 @@ Moonbeam
Moonriver
Mordor
Nova
ngrok
Nuxt
OAuth
OP
Expand All @@ -178,6 +181,7 @@ PKCE
Polis
Protocol Kit
Starter Kit
Prebuild
Protofire
PublicMint
README
Expand Down Expand Up @@ -282,6 +286,7 @@ trace_filter
trace_transaction
undefined
undeployed
unencrypted
v1
viem
zkLink
Expand Down
Binary file added assets/react-native-passkeys-app-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/react-native-passkeys-app-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/react-native-passkeys-app-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/react-native-passkeys-app.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/react-native-passkeys-play-store.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions examples/react-native-passkeys/.env-sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Fill this information to configure your Safe account
# ---------------------------------------------------
# The private key of the Safe account owner that will be used to deploy the Safe or execute transactions. Should have some test Sepolia ETH.
EXPO_PUBLIC_SAFE_SIGNER_PK=add_private_key_here
# Add the Safe account owners. You can one or more public addresses that you own.
EXPO_PUBLIC_SAFE_OWNERS=["0xOwnerAddress1", "..."]
# Safe salt nonce. A random number that is used to generate to Safe account address. When you change the number a new Safe will be predicted.
# This is useful to start testing the app with a new Safe account.
EXPO_PUBLIC_SAFE_SALT_NONCE=1

# Others
# ---------------------------------------------------
# RPC URL for the network where the Safe is deployed
EXPO_PUBLIC_RPC_URL=https://eth-sepolia.public.blastapi.io
Loading

0 comments on commit 95f09c0

Please sign in to comment.