{"id":13685018,"url":"https://github.com/krpeacock/auth-client-demo","last_synced_at":"2025-05-01T00:34:10.249Z","repository":{"id":105444331,"uuid":"365069513","full_name":"krpeacock/auth-client-demo","owner":"krpeacock","description":"Example demo of how to use https://www.npmjs.com/package/@dfinity/auth-client to make authenticated calls to an IC app","archived":false,"fork":false,"pushed_at":"2025-04-04T18:29:07.000Z","size":3103,"stargazers_count":75,"open_issues_count":7,"forks_count":32,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-04T19:42:05.628Z","etag":null,"topics":["authentication","internet-computer","javascript"],"latest_commit_sha":null,"homepage":"https://vasb2-4yaaa-aaaab-qadoa-cai.ic0.app/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/krpeacock.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-07T00:17:38.000Z","updated_at":"2025-04-04T18:29:11.000Z","dependencies_parsed_at":"2024-01-03T02:47:44.792Z","dependency_job_id":"44b6b77f-a426-4be2-a7cb-5929d6a6e3a8","html_url":"https://github.com/krpeacock/auth-client-demo","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krpeacock%2Fauth-client-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krpeacock%2Fauth-client-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krpeacock%2Fauth-client-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krpeacock%2Fauth-client-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/krpeacock","download_url":"https://codeload.github.com/krpeacock/auth-client-demo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251803631,"owners_count":21646459,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentication","internet-computer","javascript"],"created_at":"2024-08-02T14:00:42.229Z","updated_at":"2025-05-01T00:34:09.804Z","avatar_url":"https://github.com/krpeacock.png","language":"JavaScript","funding_links":[],"categories":["Front-end"],"sub_categories":[],"readme":"---\nkeywords: [intermediate, motoko, authentication, internet identity, integrate, auth, user auth]\n---\n\n# Auth-client \n\n[View this sample's code on GitHub](https://github.com/dfinity/examples/tree/master/motoko/auth_client_demo)\n\nThis is an example project intended to demonstrate how a developer might integrate with [Internet Identity](https://identity.ic0.app).\n\n:::info\nThis example uses TypeScript. See an alternative [vanilla JS example](https://github.com/krpeacock/auth-client-demo/tree/vanilla-js).\n:::\n\n[View a live demo of this sample](https://vasb2-4yaaa-aaaab-qadoa-cai.ic0.app/).\n\nThis example shows how to use [@dfinity/auth-client](https://www.npmjs.com/package/@dfinity/auth-client).\n\n## Setting up for local development\n\nTo get started, start a local `dfx` development environment in this directory with the following steps:\n\n```bash\ngit clone https://github.com/dfinity/examples\ncd examples/motoko/auth-client-demo/\ndfx start --background --clean\ndfx deps deploy\ndfx deploy\n```\n\nThis will deploy the vanilla JS (using lit-html) version of the application as well as Internet Identity and the `whoami` canister. You can access the canister using the link provided from running `dfx deploy`\n\nOnce deployed, start the development server with `npm start`.\n\nYou can now access the app at `http://127.0.0.1:5173/`.\n\n## Multiple versions\n\nThis 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:\n\n- React\n- Vue\n- Vanilla\n- Svelte\n\n\u003e Note: the svelte project was created using sveltekit, and has its own `package.json`. Cd into ./src/auth_client_demo_assets/svelte and run `npm install` to run the svelte version.\n\nYou can also deploy each of the frontend canisters by editing `package.json` to run the `build:version` script, and `dfx.json` to pull from the `dist` directory of that framework.\n\n## Pulling Internet Identity into your project\n\nTo pull Internet Identity into your project, you'll need to do the following:\n\n- #### Step 1: Add Internet Identity to your `dfx.json` file:\n\n```json\n\"internet-identity\" : {\n    \"type\": \"pull\",\n    \"id\": \"rdmx6-jaaaa-aaaaa-aaadq-cai\"\n}\n```\n\n- #### Step 2: Run the following commands to install the dependencies:\n\n```bash\ndfx deps pull\ndfx deps init --argument '(null)' internet-identity\ndfx deps deploy\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrpeacock%2Fauth-client-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkrpeacock%2Fauth-client-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrpeacock%2Fauth-client-demo/lists"}