Skip to content

Commit

Permalink
Update identity usage in README and package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
kristoferlund committed Jan 19, 2024
1 parent 0654862 commit 4549f1b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export function LoginButton() {

The `identity` context variable contains the identity of the currently logged in user. The identity is available after successfully loading the identity from local storage or completing the login process.

The preferred way to use the identity is to connect it to the [ic-use-actor](https://www.npmjs.com/kristoferlund/ic-use-actor) hook. This allows you to easily call canister methods that require authentication.
The preferred way to use the identity is to connect it to the [ic-use-actor](https://www.npmjs.com/kristoferlund/ic-use-actor) hook. The hook provides a typed interface to the canister methods as well as interceptor functions for handling errors etc.

```jsx
// Actors.tsx
Expand Down
17 changes: 15 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@
"name": "ic-use-internet-identity",
"version": "0.0.1",
"description": "",
"author": "Kristofer Lund <kristofer@kristoferlund.se>",
"repository": {
"type": "git",
"url": "https://github.com/kristoferlund/ic-use-internet-identity-demo"
},
"bugs": "https://github.com/kristoferlund/ic-use-internet-identity-demo/issues",
"homepage": "https://github.com/kristoferlund/ic-use-internet-identity-demo",
"keywords": [
"dfinity",
"ic",
"internet computer",
"internet identity",
"react",
"hook"
],
"type": "module",
"main": "dist/index.js",
"scripts": {
Expand All @@ -13,8 +28,6 @@
"dev:tsc": "tsc --watch --preserveWatchOutput",
"dev:esbuild": "npm run build --watch"
},
"keywords": [],
"author": "",
"license": "MIT",
"dependencies": {
"@dfinity/agent": "^0.20.2",
Expand Down

0 comments on commit 4549f1b

Please sign in to comment.