-
Notifications
You must be signed in to change notification settings - Fork 402
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #637 from dfinity/add-auth-client-demo-to-examples
- Loading branch information
Showing
55 changed files
with
25,636 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
name: "tagged-release" | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
jobs: | ||
tagged-release: | ||
name: "Tagged Release" | ||
runs-on: "ubuntu-latest" | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js 16 | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 16 | ||
- name: "Install Packages" | ||
run: npm install | ||
|
||
- name: "Install DFX" | ||
run: echo y | sh -ci "$(curl -fsSL https://sdk.dfinity.org/install.sh)" | ||
|
||
- name: "Release" | ||
run: npm run release | ||
|
||
- uses: "marvinpinto/action-automatic-releases@latest" | ||
with: | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
prerelease: false | ||
files: | | ||
dist/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Various IDEs and Editors | ||
.vscode/ | ||
.idea/ | ||
**/*~ | ||
|
||
# Mac OSX temporary files | ||
.DS_Store | ||
**/.DS_Store | ||
|
||
# dfx temporary files | ||
.dfx/ | ||
|
||
# frontend code | ||
node_modules/ | ||
dist/ | ||
.env | ||
|
||
src/declarations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Auth-Client Demo | ||
|
||
This is an example project, intended to demonstrate how an app developer might integrate with an [Internet Identity](https://identity.ic0.app). | ||
|
||
For a non-typescript implementation, see https://github.com/krpeacock/auth-client-demo/tree/vanilla-js | ||
|
||
[Live demo](https://vasb2-4yaaa-aaaab-qadoa-cai.ic0.app/) | ||
|
||
This is an example showing how to use [@dfinity/auth-client](https://www.npmjs.com/package/@dfinity/auth-client). | ||
|
||
## Setting up for local development | ||
|
||
To get started, start a local dfx development environment in this directory with the following steps: | ||
|
||
```bash | ||
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/`. | ||
|
||
## Multiple Versions | ||
|
||
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 | ||
|
||
## Pulling Internet Identity into your own project | ||
|
||
To pull Internet Identity into your own project, you'll need to do the following: | ||
|
||
1. Add Internet Identity to your `dfx.json` file: | ||
|
||
```json | ||
"internet-identity" : { | ||
"type": "pull", | ||
"id": "rdmx6-jaaaa-aaaaa-aaadq-cai" | ||
} | ||
``` | ||
|
||
2. Run the following commands to install the dependencies: | ||
|
||
```bash | ||
dfx deps pull | ||
dfx deps init --argument '(null)' internet-identity | ||
dfx deps deploy | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"auth_client_demo_assets": { | ||
"ic": "vasb2-4yaaa-aaaab-qadoa-cai" | ||
}, | ||
"svelte": { | ||
"ic": "rxrf5-eiaaa-aaaab-qaihq-cai" | ||
}, | ||
"whoami": { | ||
"ic": "ivcos-eqaaa-aaaab-qablq-cai", | ||
"ic-old": "hihv6-xiaaa-aaaab-qaapa-cai" | ||
}, | ||
"www": { | ||
"ic": "jymk4-lyaaa-aaaab-qabma-cai", | ||
"ic-old": "hpgtk-2qaaa-aaaab-qaapq-cai" | ||
} | ||
} |
Oops, something went wrong.