@privy-io/react-auth 1.41.0 → 1.42.0-beta-20231002210349
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/esm/index.js +196 -196
- package/dist/index.d.ts +39 -6
- package/dist/index.js +194 -194
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -509,6 +509,12 @@ interface ResponseOAuthGithub {
|
|
|
509
509
|
email: string | null;
|
|
510
510
|
verified_at: number;
|
|
511
511
|
}
|
|
512
|
+
interface ResponseOAuthTiktok {
|
|
513
|
+
type: 'tiktok_oauth';
|
|
514
|
+
subject: string;
|
|
515
|
+
username: string | null;
|
|
516
|
+
verified_at: number;
|
|
517
|
+
}
|
|
512
518
|
interface ResponseOAuthLinkedIn {
|
|
513
519
|
type: 'linkedin_oauth';
|
|
514
520
|
subject: string;
|
|
@@ -527,7 +533,7 @@ interface ResponseCustomJwtAccount {
|
|
|
527
533
|
custom_user_id: string;
|
|
528
534
|
verified_at: number;
|
|
529
535
|
}
|
|
530
|
-
type LinkedAccountsResponseType = Array<ResponseEmailAccount | ResponsePhoneAccount | ResponseEthereumAccount | ResponseOAuthGoogle | ResponseOAuthTwitter | ResponseOAuthDiscord | ResponseOAuthGithub | ResponseOAuthLinkedIn | ResponseOAuthApple | ResponseCustomJwtAccount>;
|
|
536
|
+
type LinkedAccountsResponseType = Array<ResponseEmailAccount | ResponsePhoneAccount | ResponseEthereumAccount | ResponseOAuthGoogle | ResponseOAuthTwitter | ResponseOAuthDiscord | ResponseOAuthGithub | ResponseOAuthTiktok | ResponseOAuthLinkedIn | ResponseOAuthApple | ResponseCustomJwtAccount>;
|
|
531
537
|
interface GetCurrentUserResponse {
|
|
532
538
|
id: string;
|
|
533
539
|
created_at: number;
|
|
@@ -789,7 +795,7 @@ type MoonpaySignResponse = {
|
|
|
789
795
|
externalTransactionId: string;
|
|
790
796
|
};
|
|
791
797
|
|
|
792
|
-
declare const SUPPORTED_OAUTH_PROVIDERS: readonly ["google", "discord", "twitter", "github", "linkedin", "apple"];
|
|
798
|
+
declare const SUPPORTED_OAUTH_PROVIDERS: readonly ["google", "discord", "twitter", "github", "tiktok", "linkedin", "apple"];
|
|
793
799
|
type OAuthProviderType = (typeof SUPPORTED_OAUTH_PROVIDERS)[number];
|
|
794
800
|
type EmbeddedWalletClientType = 'privy';
|
|
795
801
|
type InjectedWalletClientType = 'metamask' | 'phantom';
|
|
@@ -805,7 +811,7 @@ type WalletBranding = {
|
|
|
805
811
|
name: string;
|
|
806
812
|
icon?: string | EmbeddedSVG;
|
|
807
813
|
};
|
|
808
|
-
type LinkedAccountType = 'wallet' | 'email' | 'phone' | 'google_oauth' | 'twitter_oauth' | 'discord_oauth' | 'github_oauth' | 'linkedin_oauth' | 'apple_oauth' | 'custom_auth';
|
|
814
|
+
type LinkedAccountType = 'wallet' | 'email' | 'phone' | 'google_oauth' | 'twitter_oauth' | 'discord_oauth' | 'github_oauth' | 'tiktok_oauth' | 'linkedin_oauth' | 'apple_oauth' | 'custom_auth';
|
|
809
815
|
/** @ignore */
|
|
810
816
|
interface LinkMetadata {
|
|
811
817
|
/** Account type, most commonly useful when filtering through linkedAccounts */
|
|
@@ -994,6 +1000,13 @@ interface Github {
|
|
|
994
1000
|
/** The email associated with the Github account. */
|
|
995
1001
|
email: string | null;
|
|
996
1002
|
}
|
|
1003
|
+
/** Object representation of a user's Tiktok account. */
|
|
1004
|
+
interface Tiktok {
|
|
1005
|
+
/** The `sub` claim from the Tiktok-issued JWT for this account. */
|
|
1006
|
+
subject: string;
|
|
1007
|
+
/** The username associated with the Tiktok account. */
|
|
1008
|
+
username: string | null;
|
|
1009
|
+
}
|
|
997
1010
|
/** Object representation of a user's LinkedIn account. */
|
|
998
1011
|
interface LinkedIn {
|
|
999
1012
|
/** The `sub` claim from the LinkedIn-issued JWT for this account. */
|
|
@@ -1049,6 +1062,11 @@ interface GithubOAuthWithMetadata extends LinkMetadata, Github {
|
|
|
1049
1062
|
/** Denotes that this is a Github account. */
|
|
1050
1063
|
type: 'github_oauth';
|
|
1051
1064
|
}
|
|
1065
|
+
/** Object representation of a user's Tiktok Account, with additional metadata for advanced use cases. */
|
|
1066
|
+
interface TiktokOAuthWithMetadata extends LinkMetadata, Tiktok {
|
|
1067
|
+
/** Denotes that this is a Tiktok account. */
|
|
1068
|
+
type: 'tiktok_oauth';
|
|
1069
|
+
}
|
|
1052
1070
|
/** Object representation of a user's LinkedIn Account, with additional metadata for advanced use cases. */
|
|
1053
1071
|
interface LinkedInOAuthWithMetadata extends LinkMetadata, LinkedIn {
|
|
1054
1072
|
/** Denotes that this is a LinkedIn account. */
|
|
@@ -1067,7 +1085,7 @@ interface CustomJwtAccountWithMetadata extends LinkMetadata, CustomJwtAccount {
|
|
|
1067
1085
|
/**
|
|
1068
1086
|
* Object representation of a user's linked accounts
|
|
1069
1087
|
*/
|
|
1070
|
-
type LinkedAccountWithMetadata = WalletWithMetadata | EmailWithMetadata | PhoneWithMetadata | GoogleOAuthWithMetadata | TwitterOAuthWithMetadata | DiscordOAuthWithMetadata | GithubOAuthWithMetadata | LinkedInOAuthWithMetadata | AppleOAuthWithMetadata | CustomJwtAccountWithMetadata;
|
|
1088
|
+
type LinkedAccountWithMetadata = WalletWithMetadata | EmailWithMetadata | PhoneWithMetadata | GoogleOAuthWithMetadata | TwitterOAuthWithMetadata | DiscordOAuthWithMetadata | GithubOAuthWithMetadata | TiktokOAuthWithMetadata | LinkedInOAuthWithMetadata | AppleOAuthWithMetadata | CustomJwtAccountWithMetadata;
|
|
1071
1089
|
interface User {
|
|
1072
1090
|
/** The Privy-issued DID for the user. If you need to store additional information
|
|
1073
1091
|
* about a user, you can use this DID to reference them. */
|
|
@@ -1091,6 +1109,8 @@ interface User {
|
|
|
1091
1109
|
discord?: Discord;
|
|
1092
1110
|
/** The user's Github account, if they have linked one. It cannot be linked to another user. */
|
|
1093
1111
|
github?: Github;
|
|
1112
|
+
/** The user's Tiktok account, if they have linked one. It cannot be linked to another user. */
|
|
1113
|
+
tiktok?: Tiktok;
|
|
1094
1114
|
/** The user's LinkedIn account, if they have linked one. It cannot be linked to another user. */
|
|
1095
1115
|
linkedin?: LinkedIn;
|
|
1096
1116
|
/** The user's Apple account, if they have linked one. It cannot be linked to another user. */
|
|
@@ -1112,6 +1132,7 @@ type PrivyServerConfig = {
|
|
|
1112
1132
|
twitterOAuth?: boolean;
|
|
1113
1133
|
discordOAuth?: boolean;
|
|
1114
1134
|
githubOAuth?: boolean;
|
|
1135
|
+
tiktokOAuth?: boolean;
|
|
1115
1136
|
linkedinOAuth?: boolean;
|
|
1116
1137
|
appleOAuth?: boolean;
|
|
1117
1138
|
termsAndConditionsUrl: string | null;
|
|
@@ -1161,7 +1182,7 @@ type PrivyClientConfig = {
|
|
|
1161
1182
|
* Social login methods require `email` OR `sms` to also be specified.
|
|
1162
1183
|
* `loginMethods` cannot be an empty array if specified.
|
|
1163
1184
|
* The order of this array does not currently dictate order of the login methods in the UI, but may in the future. */
|
|
1164
|
-
loginMethods?: Array<'wallet' | 'email' | 'sms' | 'google' | 'twitter' | 'discord' | 'github' | 'linkedin' | 'apple'>;
|
|
1185
|
+
loginMethods?: Array<'wallet' | 'email' | 'sms' | 'google' | 'twitter' | 'discord' | 'github' | 'linkedin' | 'tiktok' | 'apple'>;
|
|
1165
1186
|
/**
|
|
1166
1187
|
* This property is only required for apps that use a third-party authentication provider.
|
|
1167
1188
|
*/
|
|
@@ -1518,6 +1539,11 @@ interface PrivyInterface {
|
|
|
1518
1539
|
* This will directly initiate the OAuth flow for Github.
|
|
1519
1540
|
*/
|
|
1520
1541
|
linkGithub: () => void;
|
|
1542
|
+
/**
|
|
1543
|
+
* For users who are authenticated, prompts the user to link Tiktok OAuth account
|
|
1544
|
+
* This will directly initiate the OAuth flow for Tiktok.
|
|
1545
|
+
*/
|
|
1546
|
+
linkTiktok: () => void;
|
|
1521
1547
|
/**
|
|
1522
1548
|
* For users who are authenticated, prompts the user to link LinkedIn OAuth account
|
|
1523
1549
|
* This will directly initiate the OAuth flow for LinkedIn.
|
|
@@ -1626,6 +1652,13 @@ interface PrivyInterface {
|
|
|
1626
1652
|
* @returns Promise for the {@link User} object after the provided Github account has been unlinked
|
|
1627
1653
|
*/
|
|
1628
1654
|
unlinkGithub: (subject: string) => Promise<User>;
|
|
1655
|
+
/**
|
|
1656
|
+
* Unlink a Tiktok social account from a user, by passing the tiktok subject ID. Note that you can only unlink a social account if the user has at least one other account.
|
|
1657
|
+
*
|
|
1658
|
+
* @param subject {string} tiktok account's subject ID
|
|
1659
|
+
* @returns Promise for the {@link User} object after the provided Tiktok account has been unlinked
|
|
1660
|
+
*/
|
|
1661
|
+
unlinkTiktok: (subject: string) => Promise<User>;
|
|
1629
1662
|
/**
|
|
1630
1663
|
* Unlink a LinkedIn social account from a user, by passing the linkedin subject ID. Note that you can only unlink a social account if the user has at least one other account.
|
|
1631
1664
|
*
|
|
@@ -1878,4 +1911,4 @@ declare function useCreateWallet(callbacks?: PrivyEvents['createWallet']): {
|
|
|
1878
1911
|
createWallet: () => Promise<Wallet>;
|
|
1879
1912
|
};
|
|
1880
1913
|
|
|
1881
|
-
export { Apple, AppleOAuthWithMetadata, AsExternalProvider, CallbackError, ConnectedWallet, ConnectorManager, ContractUIOptions, Discord, DiscordOAuthWithMetadata, EIP1193Provider, Email, EmailWithMetadata, FundWalletConfig, Github, GithubOAuthWithMetadata, Google, GoogleOAuthWithMetadata, LinkedIn, LinkedInOAuthWithMetadata, MoonpayConfig, MoonpayCurrencyCode, MoonpayPaymentMethod, Phone, PhoneWithMetadata, PrivyClient, PrivyClientConfig, PrivyEvents, PrivyInterface, PrivyProvider, PrivyProviderProps, PrivyProxyProvider, Quantity, DEFAULT_SUPPORTED_CHAINS as SUPPORTED_CHAINS, SendTransactionModalUIOptions, SignMessageModalUIOptions, TransactionLog, TransactionReceipt, TransactionUIOptions, Twitter, TwitterOAuthWithMetadata, UnsignedTransactionRequest, UseWalletsInterface, User, VERSION, Wallet, WalletConnector, WalletWithMetadata, getAccessToken, useConnectWallet, useCreateWallet, useLogin, useLogout, usePrivy, useWallets };
|
|
1914
|
+
export { Apple, AppleOAuthWithMetadata, AsExternalProvider, CallbackError, ConnectedWallet, ConnectorManager, ContractUIOptions, Discord, DiscordOAuthWithMetadata, EIP1193Provider, Email, EmailWithMetadata, FundWalletConfig, Github, GithubOAuthWithMetadata, Google, GoogleOAuthWithMetadata, LinkedIn, LinkedInOAuthWithMetadata, MoonpayConfig, MoonpayCurrencyCode, MoonpayPaymentMethod, Phone, PhoneWithMetadata, PrivyClient, PrivyClientConfig, PrivyEvents, PrivyInterface, PrivyProvider, PrivyProviderProps, PrivyProxyProvider, Quantity, DEFAULT_SUPPORTED_CHAINS as SUPPORTED_CHAINS, SendTransactionModalUIOptions, SignMessageModalUIOptions, Tiktok, TiktokOAuthWithMetadata, TransactionLog, TransactionReceipt, TransactionUIOptions, Twitter, TwitterOAuthWithMetadata, UnsignedTransactionRequest, UseWalletsInterface, User, VERSION, Wallet, WalletConnector, WalletWithMetadata, getAccessToken, useConnectWallet, useCreateWallet, useLogin, useLogout, usePrivy, useWallets };
|