Skip to content
This repository was archived by the owner on Aug 30, 2022. It is now read-only.

Commit 0ee4ac7

Browse files
authored
enable auth usage with <ThirdwebSDKProvider/> (#129)
* minor cleanups * enable auth usage with raw provider * cleanup exports
1 parent a801930 commit 0ee4ac7

18 files changed

+123
-66
lines changed

docs/react.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ import { useGnosis } from "@thirdweb-dev/react"
6666
| [useLazyMint(contract, onProgress)](./react.uselazymint.md) | <b><i>(BETA)</i></b> Use this to lazy mint a batch of NFTs on your [DropContract](./react.dropcontract.md) |
6767
| [useListing(contract, listingId)](./react.uselisting.md) | <b><i>(BETA)</i></b> Use this to get a specific listing from the marketplace. |
6868
| [useListings(contract, filter)](./react.uselistings.md) | <b><i>(BETA)</i></b> Use this to get a list all listings from your marketplace contract. |
69-
| [useLogin(config)](./react.uselogin.md) | Hook to securely login to a backend with the connected wallet. The backend authentication URL must be configured on the ThirdwebProvider. |
70-
| [useLogout()](./react.uselogout.md) | Hook to logout the connected wallet from the backend. The backend logout URL must be configured on the ThirdwebProvider. |
69+
| [useLogin(config)](./react.uselogin.md) | <b><i>(BETA)</i></b> Hook to securely login to a backend with the connected wallet. The backend authentication URL must be configured on the ThirdwebProvider. |
70+
| [useLogout()](./react.uselogout.md) | <b><i>(BETA)</i></b> Hook to logout the connected wallet from the backend. The backend logout URL must be configured on the ThirdwebProvider. |
7171
| [useMagic()](./react.usemagic.md) | <p>Hook for connecting to an email wallet using magic link. This enables users without their own wallets to connect to your application and sign transactions securely using their email.</p>
7272
```javascript
7373
import { useMagic } from "@thirdweb-dev/react"
@@ -122,7 +122,7 @@ import { useNetworkMistmatch } from "@thirdweb-dev/react"
122122
| [useUpdatePlatformFees(contract)](./react.useupdateplatformfees.md) | <b><i>(BETA)</i></b> Use this to update the platform fees settings of your |
123123
| [useUpdatePrimarySaleRecipient(contract)](./react.useupdateprimarysalerecipient.md) | <b><i>(BETA)</i></b> Use this to update the primary sales recipient of your |
124124
| [useUpdateRoyaltySettings(contract)](./react.useupdateroyaltysettings.md) | <b><i>(BETA)</i></b> Use this to update the royalty settings of your |
125-
| [useUser()](./react.useuser.md) | Hook to get the currently logged in user. |
125+
| [useUser()](./react.useuser.md) | <b><i>(BETA)</i></b> Hook to get the currently logged in user. |
126126
| [useVote(contractAddress)](./react.usevote.md) | Hook for getting an instance of an <code>Vote</code> contract. This contract enables fully featured voting-based decentralized governance systems. |
127127
| [useWalletConnect()](./react.usewalletconnect.md) | <p>Hook for connecting to a mobile wallet with Wallet Connect</p>
128128
```javascript
@@ -140,7 +140,7 @@ import { useWalletConnect } from "@thirdweb-dev/react"
140140
| [MediaRendererProps](./react.mediarendererprops.md) | The props for the [MediaRenderer](./react.mediarenderer.md) component. |
141141
| [MediaType](./react.mediatype.md) | |
142142
| [SharedMediaProps](./react.sharedmediaprops.md) | |
143-
| [ThirdwebAuthConfig](./react.thirdwebauthconfig.md) | |
143+
| [ThirdwebAuthConfig](./react.thirdwebauthconfig.md) | <b><i>(BETA)</i></b> The configuration to use the react SDK with an \[auth\](https://portal.thirdweb.com/auth) server. |
144144
| [ThirdwebNftMediaProps](./react.thirdwebnftmediaprops.md) | The props for the [ThirdwebNftMedia](./react.thirdwebnftmedia.md) component. |
145145
| [ThirdwebProviderProps](./react.thirdwebproviderprops.md) | The possible props for the ThirdwebProvider. |
146146
| [ThirdwebSDKProviderProps](./react.thirdwebsdkproviderprops.md) | |

docs/react.thirdwebauthconfig.authurl.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44

55
## ThirdwebAuthConfig.authUrl property
66

7-
The backend URL of the authentication endoints. For example, if your endpoints are at /api/auth/login, /api/auth/logout, etc. then this should be set to "/api/auth".
7+
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
8+
>
9+
10+
The backend URL of the authentication endoints. For example, if your endpoints are at `/api/auth/login`<!-- -->, `/api/auth/logout`<!-- -->, etc. then this should be set to `/api/auth`<!-- -->.
811

912
<b>Signature:</b>
1013

docs/react.thirdwebauthconfig.domain.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
## ThirdwebAuthConfig.domain property
66

7+
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
8+
>
9+
710
The frontend domain used to generate the login payload. This domain should match the domain used on your auth backend.
811

912
<b>Signature:</b>

docs/react.thirdwebauthconfig.loginredirect.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
## ThirdwebAuthConfig.loginRedirect property
66

7+
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
8+
>
9+
710
The URL to redirect to after a succesful login.
811

912
<b>Signature:</b>

docs/react.thirdwebauthconfig.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44

55
## ThirdwebAuthConfig interface
66

7+
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
8+
>
9+
10+
The configuration to use the react SDK with an \[auth\](https://portal.thirdweb.com/auth) server.
11+
712
<b>Signature:</b>
813

914
```typescript
@@ -14,7 +19,7 @@ export interface ThirdwebAuthConfig
1419

1520
| Property | Modifiers | Type | Description |
1621
| --- | --- | --- | --- |
17-
| [authUrl](./react.thirdwebauthconfig.authurl.md) | | string | The backend URL of the authentication endoints. For example, if your endpoints are at /api/auth/login, /api/auth/logout, etc. then this should be set to "/api/auth". |
18-
| [domain](./react.thirdwebauthconfig.domain.md) | | string | The frontend domain used to generate the login payload. This domain should match the domain used on your auth backend. |
19-
| [loginRedirect?](./react.thirdwebauthconfig.loginredirect.md) | | string | <i>(Optional)</i> The URL to redirect to after a succesful login. |
22+
| [authUrl](./react.thirdwebauthconfig.authurl.md) | | string | <b><i>(BETA)</i></b> The backend URL of the authentication endoints. For example, if your endpoints are at <code>/api/auth/login</code>, <code>/api/auth/logout</code>, etc. then this should be set to <code>/api/auth</code>. |
23+
| [domain](./react.thirdwebauthconfig.domain.md) | | string | <b><i>(BETA)</i></b> The frontend domain used to generate the login payload. This domain should match the domain used on your auth backend. |
24+
| [loginRedirect?](./react.thirdwebauthconfig.loginredirect.md) | | string | <b><i>(BETA)</i></b> <i>(Optional)</i> The URL to redirect to after a succesful login. |
2025

docs/react.thirdwebsdkproviderprops.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
```typescript
1010
export interface ThirdwebSDKProviderProps extends Omit<ThirdwebSDKProviderWagmiWrapper, "queryClient">
1111
```
12-
<b>Extends:</b> Omit&lt;[ThirdwebSDKProviderWagmiWrapper](./react.thirdwebsdkproviderwagmiwrapper.md)
12+
<b>Extends:</b> Omit&lt;[ThirdwebSDKProviderWagmiWrapper](./react.thirdwebsdkproviderwagmiwrapper.md)<!-- -->, "queryClient"&gt;
1313
1414
## Properties
1515

docs/react.thirdwebsdkproviderwagmiwrapper.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
<b>Signature:</b>
88

99
```typescript
10-
export interface ThirdwebSDKProviderWagmiWrapper extends Pick<ThirdwebProviderProps, "desiredChainId" | "sdkOptions" | "storageInterface">
10+
export interface ThirdwebSDKProviderWagmiWrapper extends Pick<ThirdwebProviderProps, "desiredChainId" | "sdkOptions" | "storageInterface" | "authConfig">
1111
```
12-
<b>Extends:</b> Pick&lt;[ThirdwebProviderProps](./react.thirdwebproviderprops.md)
12+
<b>Extends:</b> Pick&lt;[ThirdwebProviderProps](./react.thirdwebproviderprops.md)<!-- -->, "desiredChainId" \| "sdkOptions" \| "storageInterface" \| "authConfig"&gt;
1313
1414
## Properties
1515

docs/react.uselogin.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
## useLogin() function
66

7+
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
8+
>
9+
710
Hook to securely login to a backend with the connected wallet. The backend authentication URL must be configured on the ThirdwebProvider.
811

912
<b>Signature:</b>

docs/react.uselogout.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
## useLogout() function
66

7+
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
8+
>
9+
710
Hook to logout the connected wallet from the backend. The backend logout URL must be configured on the ThirdwebProvider.
811

912
<b>Signature:</b>

docs/react.useuser.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
## useUser() function
66

7+
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
8+
>
9+
710
Hook to get the currently logged in user.
811

912
<b>Signature:</b>

0 commit comments

Comments
 (0)