Skip to content

Commit

Permalink
Added .env loading of Thirdweb client id
Browse files Browse the repository at this point in the history
  • Loading branch information
cameronvoell committed Jan 18, 2024
1 parent e22c676 commit 1431ac7
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 17 deletions.
3 changes: 3 additions & 0 deletions example/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ web-build/

# Temporary files created by Metro to check the health of the file watcher
.metro-health-check*

# Environment settings
.env
18 changes: 11 additions & 7 deletions example/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,28 @@ import HomeScreen from './src/HomeScreen'
import LaunchScreen from './src/LaunchScreen'
import { Navigator } from './src/Navigation'
import TestScreen from './src/TestScreen'
import { ThirdwebProvider, walletConnect } from "@thirdweb-dev/react-native";
import { ThirdwebProvider, metamaskWallet, rainbowWallet } from "@thirdweb-dev/react-native"
import { Ethereum } from "@thirdweb-dev/chains"
import Config from 'react-native-config'

const queryClient = new QueryClient()

export default function App() {
// Uncomment below to ensure correct id loaded from .env
// console.log("Thirdweb client id: " + Config.THIRD_WEB_CLIENT_ID)
return (
<ThirdwebProvider
activeChain={"ethereum"}
clientId={"<THIRD_WEB_CLIENT_ID_HERE>"}
activeChain={ Ethereum }
supportedChains={ [ Ethereum ] }
clientId={ Config.THIRD_WEB_CLIENT_ID }
dAppMeta={{
name: "XMTP Example",
description: "This basic messaging app has an intentionally unopinionated UI to help make it easier for you to build with.",
description: "Example app from xmtp-react-native repo",
logoUrl: "https://pbs.twimg.com/profile_images/1668323456935510016/2c_Ue8dF_400x400.jpg",
url: "https://xmtp.org",
}}
supportedWallets={[
walletConnect({
recommended: true,
})
metamaskWallet(), rainbowWallet()
]}>
<QueryClientProvider client={queryClient}>
<XmtpProvider>
Expand Down
1 change: 1 addition & 0 deletions example/EXAMPLE.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
THIRD_WEB_CLIENT_ID="INSERT_CLIENT_ID_HERE"
19 changes: 9 additions & 10 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,10 @@ PODS:
- glog
- react-native-blob-util (0.19.6):
- React-Core
- react-native-config (1.5.1):
- react-native-config/App (= 1.5.1)
- react-native-config/App (1.5.1):
- React-Core
- react-native-encrypted-storage (4.0.3):
- React-Core
- react-native-get-random-values (1.10.0):
Expand Down Expand Up @@ -489,6 +493,7 @@ DEPENDENCIES:
- React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`)
- React-logger (from `../node_modules/react-native/ReactCommon/logger`)
- react-native-blob-util (from `../node_modules/react-native-blob-util`)
- react-native-config (from `../node_modules/react-native-config`)
- react-native-encrypted-storage (from `../node_modules/react-native-encrypted-storage`)
- react-native-get-random-values (from `../node_modules/react-native-get-random-values`)
- react-native-mmkv (from `../node_modules/react-native-mmkv`)
Expand Down Expand Up @@ -607,6 +612,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/logger"
react-native-blob-util:
:path: "../node_modules/react-native-blob-util"
react-native-config:
:path: "../node_modules/react-native-config"
react-native-encrypted-storage:
:path: "../node_modules/react-native-encrypted-storage"
react-native-get-random-values:
Expand Down Expand Up @@ -708,6 +715,7 @@ SPEC CHECKSUMS:
React-jsinspector: 7bf923954b4e035f494b01ac16633963412660d7
React-logger: 655ff5db8bd922acfbe76a4983ffab048916343e
react-native-blob-util: d8fa1a7f726867907a8e43163fdd8b441d4489ea
react-native-config: 86038147314e2e6d10ea9972022aa171e6b1d4d8
react-native-encrypted-storage: db300a3f2f0aba1e818417c1c0a6be549038deb7
react-native-get-random-values: 384787fd76976f5aec9465aff6fa9e9129af1e74
react-native-mmkv: e97c0c79403fb94577e5d902ab1ebd42b0715b43
Expand Down Expand Up @@ -735,20 +743,11 @@ SPEC CHECKSUMS:
secp256k1.swift: a7e7a214f6db6ce5db32cc6b2b45e5c4dd633634
SwiftProtobuf: b02b5075dcf60c9f5f403000b3b0c202a11b6ae1
web3.swift: 2263d1e12e121b2c42ffb63a5a7beb1acaf33959
<<<<<<< HEAD
XMTP: dc02c96b475e326a4a7b3d3912cc45cf3527bd0b
XMTPReactNative: f4acdf29845869a324d9b99e2021c7050f227d99
XMTPRust: 8848a2ba761b2c961d666632f2ad27d1082faa93
Yoga: e71803b4c1fff832ccf9b92541e00f9b873119b9

PODFILE CHECKSUM: 95d6ace79946933ecf80684613842ee553dd76a2
=======
XMTP: aa137f3c8ac7b61ecfb3de0973f2dc2e672a9ec1
XMTPReactNative: e4a325b0b51dedf1a2785cad53ca3bceb1149b86
XMTPRust: 8848a2ba761b2c961d666632f2ad27d1082faa93
Yoga: e71803b4c1fff832ccf9b92541e00f9b873119b9

PODFILE CHECKSUM: bf49a4bdc3d11b67c441720989a50fa1e6be21f3
>>>>>>> main
PODFILE CHECKSUM: 95d6ace79946933ecf80684613842ee553dd76a2

COCOAPODS: 1.14.3
1 change: 1 addition & 0 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"react": "18.2.0",
"react-native": "0.71.14",
"react-native-blob-util": "^0.19.0",
"react-native-config": "^1.5.1",
"react-native-crypto": "^2.2.0",
"react-native-encrypted-storage": "^4.0.3",
"react-native-get-random-values": "^1.10.0",
Expand Down
8 changes: 8 additions & 0 deletions example/src/types/react-native-config.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
declare module 'react-native-config' {
export interface NativeConfig {
THIRD_WEB_CLIENT_ID?: string;
}

export const Config: NativeConfig
export default Config
}
5 changes: 5 additions & 0 deletions example/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13367,6 +13367,11 @@ react-native-codegen@^0.71.6:
jscodeshift "^0.14.0"
nullthrows "^1.1.1"

react-native-config@^1.5.1:
version "1.5.1"
resolved "https://registry.yarnpkg.com/react-native-config/-/react-native-config-1.5.1.tgz#73c94f511493e9b7ff9350cdf351d203a1b05acc"
integrity sha512-g1xNgt1tV95FCX+iWz6YJonxXkQX0GdD3fB8xQtR1GUBEqweB9zMROW77gi2TygmYmUkBI7LU4pES+zcTyK4HA==

react-native-crypto@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/react-native-crypto/-/react-native-crypto-2.2.0.tgz#c999ed7c96064f830e1f958687f53d0c44025770"
Expand Down

0 comments on commit 1431ac7

Please sign in to comment.