Skip to content

Commit f4d3d22

Browse files
🔄 synced file(s) with circlefin/modularwallets-web-sdk-internal (#12)
synced local file(s) with [circlefin/modularwallets-web-sdk-internal](https://github.com/circlefin/modularwallets-web-sdk-internal). <details> <summary>Changed files</summary> <ul> <li>synced local directory <code>examples/</code> with remote directory <code>examples/</code></li><li>synced local directory <code>packages/</code> with remote directory <code>packages/</code></li><li>synced local <code>pnpm-lock.yaml</code> with remote <code>pnpm-lock.yaml</code></li> </ul> </details> --- This PR was created automatically by the [repo-file-sync-action](https://github.com/BetaHuhn/repo-file-sync-action) workflow run [#14520465393](https://github.com/circlefin/modularwallets-web-sdk-internal/actions/runs/14520465393)
1 parent d711b6e commit f4d3d22

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+3363
-62
lines changed

‎examples/modular-wallets-provider/index.ts

Lines changed: 0 additions & 12 deletions
This file was deleted.

‎examples/modular-wallets-provider/package.json

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
VITE_CLIENT_KEY=
2+
VITE_CLIENT_URL=
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Passkey Recovery Example
2+
3+
This example Vite application demonstrates how to implement passkey recovery for Circle Smart Accounts. It showcases a complete flow where users can:
4+
5+
1. Create a Circle Smart Account with a passkey
6+
2. Generate and register a recovery key (as an Externally Owned Account) with their smart account
7+
3. Recover account access by using the recovery key to create a new passkey if the original one is lost
8+
9+
## Run the example app
10+
11+
Please follow the instructions to run the example app on your local machine.
12+
13+
### Environment Variables
14+
15+
Before you start to run the app, you need to make sure that all environment variables are configured correctly.
16+
17+
Make a copy of `.env.example` and rename it to `.env`.
18+
19+
Under `.env`, make sure the following environment variables are configured properly:
20+
21+
- `VITE_CLIENT_KEY`: Paste your Client Key here. You can create one in [Circle Developer Console](https://console.circle.com/wallets/modular/configurator).
22+
- `VITE_CLIENT_URL`: Paste the Client URL here. You can copy it from [Circle Developer Console](https://console.circle.com/wallets/modular/configurator).
23+
24+
Once you have these environment variables setup, you can now follow the steps below to run the app locally.
25+
26+
### Install dependencies
27+
28+
You first need to make sure you have followed the [README](https://github.com/circlefin/w3s-web-core-sdk/blob/master/README.md) under project root and have installed all dependencies under root folder:
29+
30+
```bash
31+
$ pnpm install
32+
```
33+
34+
#### Important: Build the SDK
35+
36+
Since this project uses pnpm workspaces, you must build the SDK packages before running the example:
37+
38+
```bash
39+
# From the project root directory
40+
$ pnpm build
41+
```
42+
43+
This will generate the necessary distribution files that this example depends on.
44+
45+
Now you need to go to this example folder:
46+
47+
```bash
48+
$ cd examples/passkey-recovery
49+
```
50+
51+
Once you are under the example folder, install all dependencies for the app:
52+
53+
```bash
54+
$ pnpm install
55+
```
56+
57+
### Run the app
58+
59+
To run the app locally:
60+
61+
```bash
62+
$ pnpm dev
63+
```
64+
65+
Now you should be able to see your app up and running in your browser at: `http://localhost:5173/`.
66+
67+
### Important Notes
68+
69+
**Ensure the installed SDK version is greater than or equal to `1.0.7`**
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>Passkey Recovery Example</title>
7+
</head>
8+
<body>
9+
<div id="root"></div>
10+
<script type="module" src="/index.tsx"></script>
11+
</body>
12+
</html>

0 commit comments

Comments
 (0)