Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/polite-spies-act.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@turnkey/react-native-wallet-kit": patch
"@turnkey/react-wallet-kit": patch
---

- Added `autoFetchWalletKitConfig` option to the `TurnkeyProvider` config. Setting this to false will disable the initial `walletKitConfig` fetch, saving on initialization time. If this is disabled and you want to use the `handleLogin` modal with Turnkey's Auth Proxy, you must pass in the enabled auth methods manually into the `TurnkeyProvider` config.

- Fixed `refreshWallets` and `refreshUser` not working when `autoRefreshManagedState` is disabled.
2 changes: 2 additions & 0 deletions examples/react-wallet-kit/src/providers/config/Panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ const omitKeys = [
"createSuborgParams",
"autoRefreshSession",
"oauthConfig",
"autoFetchWalletKitConfig",
"autoRefreshManagedState",
];

interface AuthMethod {
Expand Down
183 changes: 117 additions & 66 deletions packages/react-native-wallet-kit/src/providers/TurnkeyProvider.tsx

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions packages/react-native-wallet-kit/src/types/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ export interface TurnkeyProviderConfig
/** whether to automatically refresh managed state variables */
autoRefreshManagedState?: boolean;

/** whether to automatically fetch the wallet kit config on initialization. */
autoFetchWalletKitConfig?: boolean;

/** default stamper type to use for requests that require stamping. */
defaultStamperType?: StamperType;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/react-wallet-kit/src/components/auth/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ export function AuthComponent({
developerMessages={[
"You are using Turnkey's Auth Proxy, but no auth methods are enabled.",
"To use this modal, you must enable auth methods within the Turnkey dashboard.",
"If you disabled all auth methods within the TurnkeyProvider config, you will also see this error.",
"If you disabled autoFetchWalletKitConfig in the TurnkeyProvider, please ensure that you are passing in the correct auth methods in the TurnkeyProvider's auth config.",
]}
userMessages={["No authentication methods are available."]}
/>
Expand Down
Loading
Loading