Skip to content

Commit 8031bd4

Browse files
authored
refactor!: remove @dfinity/use-auth-client source code (#1264)
# Description Follow-up of #1125. The package has already been deprecated on NPM a while ago.
1 parent eebf7f2 commit 8031bd4

File tree

13 files changed

+2
-527
lines changed

13 files changed

+2
-527
lines changed

packages/use-auth-client/.gitignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

packages/use-auth-client/.npmignore

Lines changed: 0 additions & 13 deletions
This file was deleted.

packages/use-auth-client/FixJSDOMEnvironment.ts

Lines changed: 0 additions & 11 deletions
This file was deleted.

packages/use-auth-client/LICENSE

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/use-auth-client/README.md

Lines changed: 2 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,6 @@
11
# @dfinity/use-auth-client
22

3-
> **⚠️ DEPRECATED**: This package is deprecated since v3.2.3. Please use one of the following alternatives:
3+
> [!CAUTION]
4+
> This package is deprecated since v3.2.3. Please use one of the following alternatives:
45
> - [`ic-use-internet-identity`](https://www.npmjs.com/package/ic-use-internet-identity)
56
> - [`@ic-reactor/react`](https://www.npmjs.com/package/@ic-reactor/react)
6-
7-
`@dfinity/use-auth-client`! This is a package for Internet Computer React developers, making it easier to integrate the auth-client with your React application.
8-
9-
You can use it to manage your identity for you, or you can pass it an `idlFactory` and `canisterId` and it will construct and manage your entire `Actor` for you.
10-
11-
Do you want to know more about developing on the Internet Computer? Visit the [Developer Docs](https://internetcomputer.org/docs/home).
12-
13-
Additional API Documentation can be found [here](https://js.icp.build/core/v3.2/libs/use-auth-client/api).
14-
15-
---
16-
17-
## Installation
18-
19-
To install, use:
20-
21-
```shell
22-
npm install @dfinity/use-auth-client
23-
```
24-
25-
and you can import and set it up like so:
26-
27-
```ts
28-
import {useAuthClient} from '@dfinity/use-auth-client';
29-
30-
...ts
31-
const App = () => {
32-
const identityProvider =
33-
// eslint-disable-next-line no-undef
34-
process.env.DFX_NETWORK === 'local'
35-
? // eslint-disable-next-line no-undef
36-
`http://${process.env.CANISTER_ID_INTERNET_IDENTITY}.localhost:4943`
37-
: 'https://identity.internetcomputer.org';
38-
39-
const { isAuthenticated, login, logout, actor } = useAuthClient({
40-
loginOptions: {
41-
identityProvider,
42-
},
43-
actorOptions: {
44-
canisterId,
45-
idlFactory,
46-
},
47-
});
48-
...
49-
}
50-
```
51-
52-
## Multiple Actors
53-
54-
If you have multiple actors, you can pass a record of `actorOptions` to the `useAuthClient` hook. The keys of the record will be the names of the actors, and the values will be the `actorOptions` for that actor. It will look something like this:
55-
56-
```ts
57-
const { isAuthenticated, login, logout, actors } = useAuthClient({
58-
actors: {
59-
actor1: {
60-
canisterId: canisterId1,
61-
idlFactory: idlFactory1,
62-
},
63-
actor2: {
64-
canisterId: canisterId2,
65-
idlFactory: idlFactory2,
66-
},
67-
},
68-
});
69-
70-
const { actor1, actor2 } = actors;
71-
```
72-
73-
There is a live demo at https://5ibdo-haaaa-aaaab-qajia-cai.icp0.io/.

packages/use-auth-client/jest.config.mjs

Lines changed: 0 additions & 22 deletions
This file was deleted.

packages/use-auth-client/package.json

Lines changed: 0 additions & 62 deletions
This file was deleted.

packages/use-auth-client/setupTests.ts

Lines changed: 0 additions & 17 deletions
This file was deleted.

packages/use-auth-client/src/index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)