This example Vite application demonstrates how to register and log in to a Circle Smart Account using passkeys. It also showcases how to perform a user operation with the account on Polygon Amoy.
Please follow the instructions to run the example app on your local machine.
Before you start to run the app, you need to make sure that all environment variables are configured correctly.
Make a copy of .env.example
and rename it to .env
.
Under .env
, make sure the following environment variables are configured properly:
VITE_CLIENT_KEY
: Paste your Client Key here. You can create one in Circle Developer Console.VITE_CLIENT_URL
: Paste the Client URL here. You can copy it from Circle Developer Console.
Once you have these environment variables setup, you can now follow the steps below to run the app locally.
You first need to make sure you have followed the README under project root and have installed all dependencies under root folder:
$ yarn install
Now you need to go to this example folder:
$ cd examples/circle-smart-account
Once you are under the example folder, install all dependencies for the app:
$ yarn install
To run the app locally:
$ yarn dev
Now you should be able to see your app up and running in your browser at: http://localhost:5173/
.
-
Do Not Import from
src
ordist
Directories Directly:Always import the Core SDK using the package name:
import { yourFunction } from 'w3s-web-core-sdk'
-
Watching Changes from the Core SDK Package
If you are developing new SDK features, run
yarn dev
from the core SDK package directory to build your changes in real time. -
Ensure Build-Time Constants Are Replaced:
Variables like
SDK_VERSION
should be replaced during the build process. If you encounter issues, make sure you're using the compiled code from the dist directory.