diff --git a/README.md b/README.md index ad57cbe..38ba302 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Visit [UTXOS](https://utxos.dev/) for more information. - **Multi-Chain Support**: Bitcoin, Cardano, and Spark blockchains - **Developer-Controlled Wallets**: Manage wallets on behalf of users with secure backend integration -- **User-Controlled Wallets**: Non-custodial wallet solutions with OAuth integration (Google, Twitter, Discord, Apple) +- **User-Controlled Wallets**: Non-custodial wallet solutions with OAuth integration (Google, Twitter, Discord) - **Transaction Sponsorship**: Sponsor transactions for gasless user experiences - **Shard-Based Security**: Client-side key management with multi-shard encryption - **TypeScript Native**: Full type safety and IntelliSense support diff --git a/examples/nextjs/app/layout.tsx b/examples/nextjs/app/layout.tsx index 73e7ea8..086781e 100644 --- a/examples/nextjs/app/layout.tsx +++ b/examples/nextjs/app/layout.tsx @@ -2,7 +2,7 @@ import type { Metadata } from "next"; export const metadata: Metadata = { title: "UTXOS Wallet | Web3 Wallet as a Service", - description: "Connect your wallet with social login - Google, Discord, Twitter, Apple, Email", + description: "Connect your wallet with social login — Google, Discord, Twitter, Email", }; export default function RootLayout({ diff --git a/examples/nextjs/app/page.tsx b/examples/nextjs/app/page.tsx index 5093287..250959d 100644 --- a/examples/nextjs/app/page.tsx +++ b/examples/nextjs/app/page.tsx @@ -21,7 +21,6 @@ const PROVIDERS: { id: Web3AuthProvider; label: string; icon: string }[] = [ { id: "google", label: "Google", icon: "G" }, { id: "discord", label: "Discord", icon: "D" }, { id: "twitter", label: "Twitter", icon: "X" }, - { id: "apple", label: "Apple", icon: "" }, { id: "email", label: "Email", icon: "@" }, ]; diff --git a/examples/react-native/App.tsx b/examples/react-native/App.tsx index 9184f4e..8d1f34e 100644 --- a/examples/react-native/App.tsx +++ b/examples/react-native/App.tsx @@ -32,7 +32,6 @@ const PROVIDERS: { id: Web3AuthProvider; label: string; icon: string }[] = [ { id: "google", label: "Google", icon: "G" }, { id: "discord", label: "Discord", icon: "D" }, { id: "twitter", label: "Twitter", icon: "X" }, - { id: "apple", label: "Apple", icon: "" }, { id: "email", label: "Email", icon: "@" }, ]; diff --git a/package.json b/package.json index 1b2e171..a9e3bb5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@utxos/sdk", - "version": "0.2.3", + "version": "0.2.4", "description": "UTXOS SDK - Web3 infrastructure platform for UTXO blockchains", "main": "./dist/index.cjs", "module": "./dist/index.js", diff --git a/src/non-custodial/index.ts b/src/non-custodial/index.ts index 6f3006a..5167e5f 100644 --- a/src/non-custodial/index.ts +++ b/src/non-custodial/index.ts @@ -104,7 +104,11 @@ export type Web3NonCustodialProviderParams = { googleOauth2ClientId: string; twitterOauth2ClientId: string; discordOauth2ClientId: string; - appleOauth2ClientId: string; + /** + * @deprecated Apple Sign In was removed. Omit this field. If a non-empty value is passed, + * the constructor throws so misconfiguration is visible immediately instead of failing later. + */ + appleOauth2ClientId?: string; }; export type Web3NonCustodialProviderUser = { @@ -183,9 +187,13 @@ export class Web3NonCustodialProvider { googleOauth2ClientId: string; twitterOauth2ClientId: string; discordOauth2ClientId: string; - appleOauth2ClientId: string; constructor(params: Web3NonCustodialProviderParams) { + if (params.appleOauth2ClientId) { + throw new Error( + "Apple Sign no longer supported in SDK.", + ); + } this.projectId = params.projectId; this.appOrigin = params.appOrigin ? params.appOrigin : "https://utxos.dev"; this.storageLocation = params.storageLocation @@ -194,7 +202,6 @@ export class Web3NonCustodialProvider { this.googleOauth2ClientId = params.googleOauth2ClientId; this.twitterOauth2ClientId = params.twitterOauth2ClientId; this.discordOauth2ClientId = params.discordOauth2ClientId; - this.appleOauth2ClientId = params.appleOauth2ClientId; } private base64Encode(str: string): string { @@ -492,6 +499,11 @@ export class Web3NonCustodialProvider { redirectUrl: string, callback: (authorizationUrl: string) => void, ) { + if ((provider as string) === "apple") { + throw new Error( + "Apple Sign In was removed. Use google, discord, twitter, or email.", + ); + } if (provider === "google") { const googleState = JSON.stringify({ redirect: redirectUrl, @@ -549,25 +561,6 @@ export class Web3NonCustodialProvider { "https://x.com/i/oauth2/authorize?" + twitterSearchParams.toString(); callback(twitterAuthorizeUrl); return; - } else if (provider === "apple") { - const appleState = JSON.stringify({ - redirect: redirectUrl, - provider: "apple", - projectId: this.projectId, - }); - const appleSearchParams = new URLSearchParams({ - client_id: this.appleOauth2ClientId, - response_type: "code", - redirect_uri: this.appOrigin + "/api/auth", - response_mode: "form_post", - scope: "name email", - state: this.base64Encode(appleState), - }); - const appleAuthorizeUrl = - "https://appleid.apple.com/auth/authorize?" + - appleSearchParams.toString(); - callback(appleAuthorizeUrl); - return; } else if (provider === "email") { // Email uses OTP flow, not OAuth - this method should not be called for email throw new Error("Email provider uses OTP flow. Use the email OTP API endpoints instead."); diff --git a/src/types/core/index.ts b/src/types/core/index.ts index 7de1876..2cace2f 100644 --- a/src/types/core/index.ts +++ b/src/types/core/index.ts @@ -24,6 +24,10 @@ export type Web3ProjectBranding = { twitterEnabled?: boolean; discordEnabled?: boolean; googleEnabled?: boolean; + /** + * Present on legacy API payloads. Apple Sign In is no longer offered; safe to ignore in UI. + * @deprecated + */ appleEnabled?: boolean; emailEnabled?: boolean; }; @@ -58,7 +62,7 @@ export type Web3JWTBody = { username: string | null; }; -export type Web3AuthProvider = "google" | "discord" | "twitter" | "apple" | "email"; +export type Web3AuthProvider = "google" | "discord" | "twitter" | "email"; /** Role a user can have within a project */ export type Web3ProjectRole = "owner" | "admin" | "developer" | "billing"; diff --git a/src/wallet-user-controlled/index.ts b/src/wallet-user-controlled/index.ts index 3b20fc3..e741f46 100644 --- a/src/wallet-user-controlled/index.ts +++ b/src/wallet-user-controlled/index.ts @@ -3,5 +3,4 @@ export * from "./web3-wallet"; export type UserControlledWalletDirectTo = | "google" | "twitter" - | "discord" - | "apple"; + | "discord";