/phantom-connect:setup-browser-appfrom phantom-connect
Scaffolds a vanilla JS/TS app with Phantom Browser SDK for wallet integration. Handles singleton setup, connect/disconnect, Solana/EVM operations, and connection state.
Ships in phantom-connect. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
npm install @phantom/browser-sdk @solana/web3.js
Initialize a single BrowserSDK instance for your application:
import { BrowserSDK, AddressType } from "@phantom/browser-sdk";
const sdk = new BrowserSDK({
appId: "your-app-id-from-phantom-portal",
providers: ["google", "apple"],
addressTypes: [AddressType.Solana, AddressType.Ethereum],
});
Important: Create only ONE BrowserSDK instance per application. Reuse this singleton everywhere.
async function connectWallet() {
try {
const accounts = await sdk.connect();
console.log("Connected accounts:", accounts);
const solanaAccount = accounts.find((a) => a.chain === "solana");
if (solanaAccount) {
console.log("Solana address:", solanaAccount.address);
}
} catch (error) {
console.error("Connection failed:", error);
}
}
async function disconnectWallet() {
try {
await sdk.disconnect();
console.log("Disconnected");
} catch (error) {
console.error("Disconnect failed:", error);
}
}
Use sdk.solana for Solana operations and sdk.ethereum for EVM operations:
// Solana operations
const solana = sdk.solana;
// Sign and send a transaction
const { signature } = await solana.signAndSendTransaction(transaction);
// Sign a message
const { signature: msgSig } = await solana.signMessage(
new TextEncoder().encode("Hello from Phantom!")
);
function isWalletConnected(): boolean {
return sdk.isConnected;
}
function getAccounts() {
return sdk.accounts;
}
<!DOCTYPE html>
<html>
<body>
<button id="connect">Connect Wallet</button>
<button id="disconnect" style="display:none">Disconnect</button>
<p id="address"></p>
<script type="module" src="./main.ts"></script>
</body>
</html>
AddressType from @phantom/browser-sdk, not from other packages.signAndSendTransaction — signTransaction is NOT supported for embedded wallets.appId.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Claude Code refuses to install this plugin
.claude-plugin/plugin.json: agents: Invalid string: must end with ".md", mcpServers: Invalid string: must start with "./"
Checked against Claude Code 2.1.332's install rules. The listing below is what the repository ships; Claude Code cannot install it as published.
8 skills in this plugin
/add-social-loginConfigure Google and Apple social login with Phantom Connect SDK to enable embedded wallet creation/phantom-connectBuild 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.
/phantom-wallet-mcpExecute wallet operations through the Phantom MCP server — get addresses, sign transactions, transfer tokens, buy tokens, and sign messages across Solana, Ethereum, Bitcoin, and SuiOther plugins' skills for the same job