بنقرة واحدة
add-social-login
Configure Google and Apple social login with Phantom Connect SDK to enable embedded wallet creation
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Configure Google and Apple social login with Phantom Connect SDK to enable embedded wallet creation
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Build wallet-connected applications with the Phantom Connect SDK for Solana. Use when integrating Phantom wallets into React, React Native, or vanilla JS/TS apps — including wallet connection, social login (Google/Apple), transaction signing, message signing, token-gated access, crypto payments, and NFT minting. Covers @phantom/react-sdk, @phantom/react-native-sdk, and @phantom/browser-sdk.
Build and send SOL transfers with Phantom Connect SDK, including transaction construction, signing, and verification
Scaffold a vanilla JS/TS app with Phantom Browser SDK for wallet integration, without any framework dependency
Scaffold a React app with Phantom Connect SDK for wallet integration, including social login and Solana support
Scaffold a React Native (Expo) app with Phantom React Native SDK for mobile wallet integration, including polyfills and deep linking
Implement message signing with Phantom Connect SDK for Solana and EVM, including Sign-in with Solana (SIWS) authentication
| name | add-social-login |
| description | Configure Google and Apple social login with Phantom Connect SDK to enable embedded wallet creation |
appId.You must have a valid appId for social login to work.
import { PhantomProvider } from "@phantom/react-sdk";
function App() {
return (
<PhantomProvider
config={{
appId: "your-app-id-from-phantom-portal",
providers: ["google", "apple"],
addressTypes: ["solana"],
authOptions: {
redirectUrl: "https://your-app.com/auth/callback",
},
}}
>
<YourApp />
</PhantomProvider>
);
}
import { BrowserSDK, AddressType } from "@phantom/browser-sdk";
const sdk = new BrowserSDK({
appId: "your-app-id-from-phantom-portal",
providers: ["google", "apple"],
addressTypes: [AddressType.Solana],
authOptions: {
redirectUrl: "https://your-app.com/auth/callback",
},
});
import "react-native-get-random-values";
import { PhantomProvider } from "@phantom/react-native-sdk";
export default function App() {
return (
<PhantomProvider
config={{
appId: "your-app-id-from-phantom-portal",
providers: ["google", "apple"],
addressTypes: ["solana"],
scheme: "your-app-scheme",
redirectUrl: "your-app-scheme://auth/callback",
}}
>
<YourApp />
</PhantomProvider>
);
}
The ConnectButton component automatically presents social login options when providers are configured:
import { ConnectButton } from "@phantom/react-sdk";
function LoginPage() {
return (
<div>
<h1>Welcome</h1>
<p>Sign in with your Google or Apple account to get started.</p>
<ConnectButton />
</div>
);
}
Social login sessions persist for 7 days from the last authentication. Handle re-authentication gracefully:
import { useConnect } from "@phantom/react-sdk";
function SessionGuard({ children }: { children: React.ReactNode }) {
const { isConnected, connect } = useConnect();
if (!isConnected) {
return (
<div>
<p>Your session has expired. Please sign in again.</p>
<button onClick={() => connect()}>Reconnect</button>
</div>
);
}
return <>{children}</>;
}
appId is required — social login will not work without a valid app ID from Phantom Portal.providers accepts "google" and "apple" — these are the supported social login methods.redirectUrl in authOptions must be whitelisted in your Phantom Portal app settings.