Skip to content

Commit

Permalink
tkey examples update
Browse files Browse the repository at this point in the history
  • Loading branch information
yashovardhan committed Sep 22, 2023
1 parent bfc453f commit 2149b33
Show file tree
Hide file tree
Showing 8 changed files with 1,303 additions and 2,265 deletions.
1,786 changes: 658 additions & 1,128 deletions tkey-web/tkey-react-popup-example/package-lock.json

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions tkey-web/tkey-react-popup-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,20 @@
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"@tkey/default": "^9.0.1",
"@tkey/security-questions": "^9.0.0",
"@tkey/web-storage": "^9.0.0",
"@tkey/default": "^11.0.2",
"@tkey/security-questions": "^11.0.2",
"@tkey/web-storage": "^11.0.2",
"@toruslabs/constants": "^13.0.1",
"@types/jest": "^27.5.2",
"@types/node": "^17.0.45",
"@types/react": "^18.0.25",
"@types/react-dom": "^18.0.9",
"@web3auth/ethereum-provider": "^5.2.0",
"@web3auth/ethereum-provider": "^7.0.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
"sweetalert": "^2.1.2",
"typescript": "^4.9.3",
"typescript": "^5.2.2",
"web-vitals": "^2.1.4",
"web3": "^1.8.1",
"workbox-background-sync": "^6.5.4",
Expand Down
4 changes: 2 additions & 2 deletions tkey-web/tkey-react-popup-example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ function App() {
// Triggering Login using Service Provider ==> opens the popup
const loginResponse = await (tKey.serviceProvider as any).triggerLogin({
typeOfLogin: 'google',
verifier: 'google-tkey-w3a',
verifier: 'w3a-google-demo',
clientId:
'774338308167-q463s7kpvja16l4l0kko3nb925ikds2p.apps.googleusercontent.com',
'519228911939-cri01h55lsjbsia1k7ll6qpalrus75ps.apps.googleusercontent.com',
});
setUser(loginResponse.userInfo);
setOAuthShare(loginResponse.privateKey);
Expand Down
12 changes: 6 additions & 6 deletions tkey-web/tkey-react-popup-example/src/tkey.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import ThresholdKey from "@tkey/default";
import WebStorageModule from "@tkey/web-storage";
import SecurityQuestionsModule from "@tkey/security-questions";
import { TORUS_SAPPHIRE_NETWORK } from "@toruslabs/constants";

// Configuration of Service Provider
const customAuthArgs = {
web3AuthClientId: "BEglQSgt4cUWcj6SKRdu5QkOXTsePmMcusG5EAoyjyOYKlVRjIF1iCNnMOTfpzCiunHRrMui8TIwQPXdkQ8Yxuk",
baseUrl: `${window.location.origin}/serviceworker`,
network: "cyan", // based on the verifier network.
};
// Configuration of Modules
const webStorageModule = new WebStorageModule();
const securityQuestionsModule = new SecurityQuestionsModule();
Expand All @@ -18,5 +14,9 @@ export const tKey = new ThresholdKey({
webStorage: webStorageModule,
securityQuestions: securityQuestionsModule,
},
customAuthArgs: customAuthArgs as any,
customAuthArgs: {
web3AuthClientId: "BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ",
baseUrl: `${window.location.origin}/serviceworker`,
network: TORUS_SAPPHIRE_NETWORK.SAPPHIRE_MAINNET,
},
});
Loading

0 comments on commit 2149b33

Please sign in to comment.