@privy-io/react-auth 1.6.0-beta.5 → 1.6.0-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -7,7 +7,7 @@ declare type WalletType = typeof SUPPORTED_WALLET_TYPES[number];
7
7
  /** @ignore */
8
8
  interface LinkMetadata {
9
9
  /** Account type, most commonly useful when filtering through linkedAccounts */
10
- type: 'wallet' | 'email' | 'google_oauth' | 'twitter_oauth' | 'discord_oauth';
10
+ type: 'wallet' | 'email' | 'phone' | 'google_oauth' | 'twitter_oauth' | 'discord_oauth';
11
11
  /** Datetime when this account was linked to the user. */
12
12
  verifiedAt: Date;
13
13
  }
@@ -42,6 +42,11 @@ interface Email {
42
42
  /** The email address. */
43
43
  address: string;
44
44
  }
45
+ /** Object representation of a user's phone number. */
46
+ interface Phone {
47
+ /** The phone number. */
48
+ number: string;
49
+ }
45
50
  /** Object representation of a user's Google account. */
46
51
  interface Google {
47
52
  /** The `sub` claim from the Google-issued JWT for this account. */
@@ -74,6 +79,11 @@ interface EmailWithMetadata extends LinkMetadata, Email {
74
79
  /** Denotes that this is an email account. */
75
80
  type: 'email';
76
81
  }
82
+ /** Object representation of a user's phone number, with additional metadata for advanced use cases. */
83
+ interface PhoneWithMetadata extends LinkMetadata, Phone {
84
+ /** Denotes that this is a phone account. */
85
+ type: 'phone';
86
+ }
77
87
  /** Object representation of a user's wallet, with additional metadata for advanced use cases. */
78
88
  interface WalletWithMetadata extends LinkMetadata, Wallet {
79
89
  /** Denotes that this is a wallet account. */
@@ -102,6 +112,8 @@ interface User {
102
112
  createdAt: Date;
103
113
  /** The user's email address, if they have linked one. It cannot be linked to another user. */
104
114
  email?: Email;
115
+ /** The user's phone number, if they have linked one. It cannot be linked to another user. */
116
+ phone?: Phone;
105
117
  /** The user's wallet address, if they have linked one. It cannot be linked to another user. */
106
118
  wallet?: Wallet;
107
119
  /** The user's Google account, if they have linked one. It cannot be linked to another user. */
@@ -112,7 +124,7 @@ interface User {
112
124
  discord?: Discord;
113
125
  /** The list of accounts associated with this user. Each account contains additional metadata
114
126
  * that may be helpful for advanced use cases. */
115
- linkedAccounts: Array<WalletWithMetadata | EmailWithMetadata | GoogleOAuthWithMetadata | TwitterOAuthWithMetadata | DiscordOAuthWithMetadata>;
127
+ linkedAccounts: Array<WalletWithMetadata | EmailWithMetadata | PhoneWithMetadata | GoogleOAuthWithMetadata | TwitterOAuthWithMetadata | DiscordOAuthWithMetadata>;
116
128
  }
117
129
 
118
130
  /**
@@ -192,6 +204,11 @@ interface PrivyInterface {
192
204
  * This will open the Privy Modal which will guide the user through this action.
193
205
  */
194
206
  linkEmail: () => void;
207
+ /**
208
+ * For users who are authenticated, opens the Privy modal and prompts the user to link a phone number.
209
+ * This will open the Privy Modal which will guide the user through this action.
210
+ */
211
+ linkPhone: () => void;
195
212
  /**
196
213
  * For users who are authenticated, opens the Privy modal and prompts the user to link a wallet.
197
214
  * This will open the Privy Modal which will guide the user through this action.
@@ -246,6 +263,10 @@ interface PrivyInterface {
246
263
  * Unlink an email account from a user, by passing the email address. Note that you can only unlink an email account if the user has at least one other account.
247
264
  */
248
265
  unlinkEmail: (address: string) => Promise<User>;
266
+ /**
267
+ * Unlink a phone account from a user, by passing the phone number. Note that you can only unlink a phone account if the user has at least one other account.
268
+ */
269
+ unlinkPhone: (phoneNumber: string) => Promise<User>;
249
270
  /**
250
271
  * Unlink a wallet account from a user, by passing the public address. Note that you can only unlink a wallet account if the user has at least one other account.
251
272
  */
@@ -270,4 +291,4 @@ interface PrivyInterface {
270
291
  */
271
292
  declare const usePrivy: () => PrivyInterface;
272
293
 
273
- export { Discord, DiscordOAuthWithMetadata, Email, EmailWithMetadata, Google, GoogleOAuthWithMetadata, PrivyInterface, PrivyProvider, PrivyProviderProps, Twitter, TwitterOAuthWithMetadata, User, Wallet, WalletWithMetadata, usePrivy };
294
+ export { Discord, DiscordOAuthWithMetadata, Email, EmailWithMetadata, Google, GoogleOAuthWithMetadata, Phone, PhoneWithMetadata, PrivyInterface, PrivyProvider, PrivyProviderProps, Twitter, TwitterOAuthWithMetadata, User, Wallet, WalletWithMetadata, usePrivy };