diff --git a/examples/react-sdk/package-lock.json b/examples/react-sdk/package-lock.json
index 45614a72..bef23280 100644
--- a/examples/react-sdk/package-lock.json
+++ b/examples/react-sdk/package-lock.json
@@ -8,7 +8,7 @@
"name": "react-sdk",
"version": "0.0.0",
"dependencies": {
- "@corbado/react-sdk": "^0.1.7-alpha.8",
+ "@corbado/react-sdk": "^1.0.2",
"jwt-decode": "^4.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
@@ -411,20 +411,20 @@
}
},
"node_modules/@corbado/react-sdk": {
- "version": "0.1.7-alpha.8",
- "resolved": "https://registry.npmjs.org/@corbado/react-sdk/-/react-sdk-0.1.7-alpha.8.tgz",
- "integrity": "sha512-i7g+0Vue1wiBL9fbBzVEZF1s7wniO7LpequSisg1aYV5r9ICbSeXKl0YdAG/IkhLR38/Bl3pKG8tlcG1xFLr/g==",
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/@corbado/react-sdk/-/react-sdk-1.0.2.tgz",
+ "integrity": "sha512-XjOFDbjhIt7rgWIgHfWuXeFVyNJu08mVwltztYNQgBn2Oc/TDGr+QRVKoL0KxSvtgeInLXVXV5EiZdEVUBNzGw==",
"dependencies": {
- "@corbado/web-core": "^0.1.7-alpha.8"
+ "@corbado/web-core": "^1.0.2"
},
"peerDependencies": {
"react": ">=18.0.0"
}
},
"node_modules/@corbado/web-core": {
- "version": "0.1.7-alpha.8",
- "resolved": "https://registry.npmjs.org/@corbado/web-core/-/web-core-0.1.7-alpha.8.tgz",
- "integrity": "sha512-Aq9m2Ara248myRxxyvrFFJbmNCML6EMzvGADQdBkZ2xtRz6WgGlJSKCBiLIdp5BO0ds4TWaw8SqYeyrYxgbnSQ==",
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/@corbado/web-core/-/web-core-1.0.2.tgz",
+ "integrity": "sha512-8ZChtqrHpJfU4J/I8DaJLfZYobXvSoAVQoXQL6XOtSuW83vlZ+pUpACR4+SSlxZvBfGQ9rTEWJS8NOgEo0Btyw==",
"dependencies": {
"@github/webauthn-json": "^2.1.1",
"axios": "^1.6.0",
@@ -1712,9 +1712,9 @@
}
},
"node_modules/axios": {
- "version": "1.6.5",
- "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.5.tgz",
- "integrity": "sha512-Ii012v05KEVuUoFWmMW/UQv9aRIc3ZwkWDcM+h5Il8izZCtRVpDUfwpoFf7eOtajT3QiGR4yDUx7lPqHJULgbg==",
+ "version": "1.6.6",
+ "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.6.tgz",
+ "integrity": "sha512-XZLZDFfXKM9U/Y/B4nNynfCRUqNyVZ4sBC/n9GDRCkq9vd2mIvKjKKsbIh1WPmHmNbg6ND7cTBY3Y2+u1G3/2Q==",
"dependencies": {
"follow-redirects": "^1.15.4",
"form-data": "^4.0.0",
diff --git a/examples/react-sdk/package.json b/examples/react-sdk/package.json
index 2b90a584..b5f8bd1c 100644
--- a/examples/react-sdk/package.json
+++ b/examples/react-sdk/package.json
@@ -10,7 +10,7 @@
"preview": "vite preview"
},
"dependencies": {
- "@corbado/react-sdk": "^0.1.7-alpha.8",
+ "@corbado/react-sdk": "^1.0.2",
"jwt-decode": "^4.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
diff --git a/examples/react/package-lock.json b/examples/react/package-lock.json
index e5804930..bc018e46 100644
--- a/examples/react/package-lock.json
+++ b/examples/react/package-lock.json
@@ -8,12 +8,19 @@
"name": "react",
"version": "0.0.0",
"dependencies": {
- "@corbado/react": "^0.1.1-alpha.6",
+ "@corbado/react": "^1.0.3",
+ "@fortawesome/fontawesome-svg-core": "^6.5.1",
+ "@fortawesome/free-brands-svg-icons": "^6.5.1",
+ "@fortawesome/free-regular-svg-icons": "^6.5.1",
+ "@fortawesome/free-solid-svg-icons": "^6.5.1",
+ "@fortawesome/react-fontawesome": "^0.2.0",
+ "prismjs": "^1.29.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.21.1"
},
"devDependencies": {
+ "@types/prismjs": "^1.26.3",
"@types/react": "^18.2.43",
"@types/react-dom": "^18.2.17",
"@typescript-eslint/eslint-plugin": "^6.14.0",
@@ -420,12 +427,12 @@
}
},
"node_modules/@corbado/react": {
- "version": "0.1.1-alpha.8",
- "resolved": "https://registry.npmjs.org/@corbado/react/-/react-0.1.1-alpha.8.tgz",
- "integrity": "sha512-NQafxdJEwtywvcOmoiC7e50Dzb6OtJ8CHDR2pHLB/p2u8t40qAep4S5mo4k0LhohSms8uHVZJe0H4Eb6HkJHsQ==",
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@corbado/react/-/react-1.0.3.tgz",
+ "integrity": "sha512-VGwCpaoCsdonA1sle+MxJxyl13AWWz6TsaG2/ucJjJub7BLtW7EUQm7nXEDuwRdcF+yGt3/WU6QDC6ni4O3dJg==",
"dependencies": {
- "@corbado/react-sdk": "^0.1.7-alpha.8",
- "@corbado/shared-ui": "^0.1.1-alpha.8",
+ "@corbado/react-sdk": "^1.0.2",
+ "@corbado/shared-ui": "^1.0.3",
"i18next": "23.5.1",
"i18next-browser-languagedetector": "7.1.0",
"react-i18next": "13.2.2"
@@ -436,29 +443,29 @@
}
},
"node_modules/@corbado/react-sdk": {
- "version": "0.1.7-alpha.8",
- "resolved": "https://registry.npmjs.org/@corbado/react-sdk/-/react-sdk-0.1.7-alpha.8.tgz",
- "integrity": "sha512-i7g+0Vue1wiBL9fbBzVEZF1s7wniO7LpequSisg1aYV5r9ICbSeXKl0YdAG/IkhLR38/Bl3pKG8tlcG1xFLr/g==",
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/@corbado/react-sdk/-/react-sdk-1.0.2.tgz",
+ "integrity": "sha512-XjOFDbjhIt7rgWIgHfWuXeFVyNJu08mVwltztYNQgBn2Oc/TDGr+QRVKoL0KxSvtgeInLXVXV5EiZdEVUBNzGw==",
"dependencies": {
- "@corbado/web-core": "^0.1.7-alpha.8"
+ "@corbado/web-core": "^1.0.2"
},
"peerDependencies": {
"react": ">=18.0.0"
}
},
"node_modules/@corbado/shared-ui": {
- "version": "0.1.1-alpha.8",
- "resolved": "https://registry.npmjs.org/@corbado/shared-ui/-/shared-ui-0.1.1-alpha.8.tgz",
- "integrity": "sha512-vKpyHgec9cAhxdkff7l3dvNoEmnQ/BNypOQxXIH3E0yN1tXeQq05M/16uWnheNJ3ZV4ZA95b8XJHJUgrxQmNsg==",
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@corbado/shared-ui/-/shared-ui-1.0.3.tgz",
+ "integrity": "sha512-Tj4C4g39AzaJUyPhRVYNKcLkstYlnzEhq4/T+rV9SJbyGKeCaC/WqneDSbn9JXzy64J1IRCKOH9ZKtAsKmJ0jQ==",
"dependencies": {
- "@corbado/web-core": "^0.1.7-alpha.8",
+ "@corbado/web-core": "^1.0.2",
"ua-parser-js": "^1.0.37"
}
},
"node_modules/@corbado/web-core": {
- "version": "0.1.7-alpha.8",
- "resolved": "https://registry.npmjs.org/@corbado/web-core/-/web-core-0.1.7-alpha.8.tgz",
- "integrity": "sha512-Aq9m2Ara248myRxxyvrFFJbmNCML6EMzvGADQdBkZ2xtRz6WgGlJSKCBiLIdp5BO0ds4TWaw8SqYeyrYxgbnSQ==",
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/@corbado/web-core/-/web-core-1.0.2.tgz",
+ "integrity": "sha512-8ZChtqrHpJfU4J/I8DaJLfZYobXvSoAVQoXQL6XOtSuW83vlZ+pUpACR4+SSlxZvBfGQ9rTEWJS8NOgEo0Btyw==",
"dependencies": {
"@github/webauthn-json": "^2.1.1",
"axios": "^1.6.0",
@@ -928,6 +935,75 @@
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
}
},
+ "node_modules/@fortawesome/fontawesome-common-types": {
+ "version": "6.5.1",
+ "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.5.1.tgz",
+ "integrity": "sha512-GkWzv+L6d2bI5f/Vk6ikJ9xtl7dfXtoRu3YGE6nq0p/FFqA1ebMOAWg3XgRyb0I6LYyYkiAo+3/KrwuBp8xG7A==",
+ "hasInstallScript": true,
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/@fortawesome/fontawesome-svg-core": {
+ "version": "6.5.1",
+ "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-6.5.1.tgz",
+ "integrity": "sha512-MfRCYlQPXoLlpem+egxjfkEuP9UQswTrlCOsknus/NcMoblTH2g0jPrapbcIb04KGA7E2GZxbAccGZfWoYgsrQ==",
+ "hasInstallScript": true,
+ "dependencies": {
+ "@fortawesome/fontawesome-common-types": "6.5.1"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/@fortawesome/free-brands-svg-icons": {
+ "version": "6.5.1",
+ "resolved": "https://registry.npmjs.org/@fortawesome/free-brands-svg-icons/-/free-brands-svg-icons-6.5.1.tgz",
+ "integrity": "sha512-093l7DAkx0aEtBq66Sf19MgoZewv1zeY9/4C7vSKPO4qMwEsW/2VYTUTpBtLwfb9T2R73tXaRDPmE4UqLCYHfg==",
+ "hasInstallScript": true,
+ "dependencies": {
+ "@fortawesome/fontawesome-common-types": "6.5.1"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/@fortawesome/free-regular-svg-icons": {
+ "version": "6.5.1",
+ "resolved": "https://registry.npmjs.org/@fortawesome/free-regular-svg-icons/-/free-regular-svg-icons-6.5.1.tgz",
+ "integrity": "sha512-m6ShXn+wvqEU69wSP84coxLbNl7sGVZb+Ca+XZq6k30SzuP3X4TfPqtycgUh9ASwlNh5OfQCd8pDIWxl+O+LlQ==",
+ "hasInstallScript": true,
+ "dependencies": {
+ "@fortawesome/fontawesome-common-types": "6.5.1"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/@fortawesome/free-solid-svg-icons": {
+ "version": "6.5.1",
+ "resolved": "https://registry.npmjs.org/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-6.5.1.tgz",
+ "integrity": "sha512-S1PPfU3mIJa59biTtXJz1oI0+KAXW6bkAb31XKhxdxtuXDiUIFsih4JR1v5BbxY7hVHsD1RKq+jRkVRaf773NQ==",
+ "hasInstallScript": true,
+ "dependencies": {
+ "@fortawesome/fontawesome-common-types": "6.5.1"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/@fortawesome/react-fontawesome": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/@fortawesome/react-fontawesome/-/react-fontawesome-0.2.0.tgz",
+ "integrity": "sha512-uHg75Rb/XORTtVt7OS9WoK8uM276Ufi7gCzshVWkUJbHhh3svsUUeqXerrM96Wm7fRiDzfKRwSoahhMIkGAYHw==",
+ "dependencies": {
+ "prop-types": "^15.8.1"
+ },
+ "peerDependencies": {
+ "@fortawesome/fontawesome-svg-core": "~1 || ~6",
+ "react": ">=16.3"
+ }
+ },
"node_modules/@github/webauthn-json": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/@github/webauthn-json/-/webauthn-json-2.1.1.tgz",
@@ -1352,6 +1428,12 @@
"integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==",
"dev": true
},
+ "node_modules/@types/prismjs": {
+ "version": "1.26.3",
+ "resolved": "https://registry.npmjs.org/@types/prismjs/-/prismjs-1.26.3.tgz",
+ "integrity": "sha512-A0D0aTXvjlqJ5ZILMz3rNfDBOx9hHxLZYv2by47Sm/pqW35zzjusrZTryatjN/Rf8Us2gZrJD+KeHbUSTux1Cw==",
+ "dev": true
+ },
"node_modules/@types/prop-types": {
"version": "15.7.11",
"resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.11.tgz",
@@ -1746,9 +1828,9 @@
}
},
"node_modules/axios": {
- "version": "1.6.5",
- "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.5.tgz",
- "integrity": "sha512-Ii012v05KEVuUoFWmMW/UQv9aRIc3ZwkWDcM+h5Il8izZCtRVpDUfwpoFf7eOtajT3QiGR4yDUx7lPqHJULgbg==",
+ "version": "1.6.6",
+ "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.6.tgz",
+ "integrity": "sha512-XZLZDFfXKM9U/Y/B4nNynfCRUqNyVZ4sBC/n9GDRCkq9vd2mIvKjKKsbIh1WPmHmNbg6ND7cTBY3Y2+u1G3/2Q==",
"dependencies": {
"follow-redirects": "^1.15.4",
"form-data": "^4.0.0",
@@ -3216,7 +3298,6 @@
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
"integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
- "dev": true,
"engines": {
"node": ">=0.10.0"
}
@@ -3556,6 +3637,24 @@
"node": ">= 0.8.0"
}
},
+ "node_modules/prismjs": {
+ "version": "1.29.0",
+ "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.29.0.tgz",
+ "integrity": "sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/prop-types": {
+ "version": "15.8.1",
+ "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz",
+ "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==",
+ "dependencies": {
+ "loose-envify": "^1.4.0",
+ "object-assign": "^4.1.1",
+ "react-is": "^16.13.1"
+ }
+ },
"node_modules/proxy-from-env": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
@@ -3634,6 +3733,11 @@
}
}
},
+ "node_modules/react-is": {
+ "version": "16.13.1",
+ "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
+ "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
+ },
"node_modules/react-refresh": {
"version": "0.14.0",
"resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.14.0.tgz",
diff --git a/examples/react/package.json b/examples/react/package.json
index 02c91441..48b49f11 100644
--- a/examples/react/package.json
+++ b/examples/react/package.json
@@ -10,12 +10,19 @@
"preview": "vite preview"
},
"dependencies": {
- "@corbado/react": "^0.1.1-alpha.6",
+ "@corbado/react": "^1.0.3",
+ "@fortawesome/fontawesome-svg-core": "^6.5.1",
+ "@fortawesome/free-brands-svg-icons": "^6.5.1",
+ "@fortawesome/free-regular-svg-icons": "^6.5.1",
+ "@fortawesome/free-solid-svg-icons": "^6.5.1",
+ "@fortawesome/react-fontawesome": "^0.2.0",
+ "prismjs": "^1.29.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.21.1"
},
"devDependencies": {
+ "@types/prismjs": "^1.26.3",
"@types/react": "^18.2.43",
"@types/react-dom": "^18.2.17",
"@typescript-eslint/eslint-plugin": "^6.14.0",
diff --git a/examples/react/src/App.tsx b/examples/react/src/App.tsx
index 8545a2e8..da6abb5a 100644
--- a/examples/react/src/App.tsx
+++ b/examples/react/src/App.tsx
@@ -1,16 +1,17 @@
import { CorbadoProvider } from '@corbado/react';
import RouteProvider from './routes';
-import englishTranslations from './translations/en';
+import { useContext } from 'react';
+import { CustomizationsContext } from './contexts/CustomizationsContext';
function App() {
+ const { customTheme, darkMode, customTranslation } = useContext(CustomizationsContext);
+
return (
+ Documentation for customizing themes are{' '} + + here + +
++ Documentation for customizing translations are{' '} + + here + +
+{isAuthenticated ? ` ` : ` `}
+
+ {isAuthenticated ? passkeyListSnippet : authSnippet}
+
+
+
+ {installCommand}
+
+
+
+ {providerSnippet}
+
+ {isAuthenticated ? passkeyComponentBody : authComponentBody}
+ > + ); +}; diff --git a/examples/react/src/components/Guide/index.tsx b/examples/react/src/components/Guide/index.tsx new file mode 100644 index 00000000..58933d48 --- /dev/null +++ b/examples/react/src/components/Guide/index.tsx @@ -0,0 +1,19 @@ +import 'prismjs/components/prism-typescript'; +import 'prismjs/components/prism-jsx'; +import 'prismjs/components/prism-tsx'; +import 'prismjs/themes/prism-tomorrow.min.css'; +import { GuideHeader } from './GuideHeader'; +import { CommonSteps } from './CommonSteps'; +import { AuthBasedSteps } from './AuthBasedSteps'; + +export const Guide = () => { + return ( + <> +@corbado/react
👋
+ >
+ )}
+
+ onMouseIn(setBounceGithub)}
+ onPointerOut={() => onMouseOut(setBounceGithub)}
+ >
+
Welcome to Corbado React's test application
-
+ The @corbado/react
package provides a comprehensive solution for
+ integrating passkey-based authentication in React applications. It simplifies the process of managing
+ authentication states and user sessions with easy-to-use hooks and UI components.
+
@corbado/react
. The{' '}
+ {` `}
component allows your users to signUp and login with their
+ passkeys. Additionally, it provides fallback options like email one-time passcode for users who don't have a passkey
+ yet.
+ >
+);
+export const passkeyComponentBody = (
+ <>
+ You can make this possible by using the {` `}
component. It
+ shows all passkeys of the currently logged in user and allows them to add and remove passkeys.
+ >
+);
+export const installCommand = `npm install @corbado/react`;
+export const providerSnippet = `import { CorbadoProvider } from '@corbado/react';
+
+function App() {
+ return (
+