This is an example project, intended to demonstrate how an app developer might integrate with an Internet Identity.
For a non-typescript implementation, see https://github.com/krpeacock/auth-client-demo/tree/vanilla-js
This is an example showing how to use @dfinity/auth-client.
To get started, start a local dfx development environment in this directory with the following steps:
cd auth-client-demo/
dfx start --background --clean
dfx deps deploy
dfx deploy
Once deployed, start the development server with npm start
.
You can now access the app at http://127.0.0.1:5173/
.
This demo has multiple versions, each of which demonstrates a different feature of the auth-client. npm start
will run the vanilla JS version, but you can run the others by running npm run start:version
where version
is one of the following:
- React
- Vue
- Vanilla
- Svelte
To pull Internet Identity into your own project, you'll need to do the following:
- Add Internet Identity to your
dfx.json
file:
"internet-identity" : {
"type": "pull",
"id": "rdmx6-jaaaa-aaaaa-aaadq-cai"
}
- Run the following commands to install the dependencies:
dfx deps pull
dfx deps init --argument '(null)' internet-identity
dfx deps deploy