Solana Integration
Overview
This sample demonstrates how to integrate Openfort's embedded wallet infrastructure with the Solana blockchain. It showcases user creation, transaction execution on Solana, and cross-chain capabilities with EVM networks.
Project Structure
solana-sample/
├── src/
│ ├── App.tsx # Main application component
│ ├── Login.tsx # Authentication flow
│ ├── content.tsx # UI content and components
│ ├── solana.tsx # Solana blockchain interactions
│ ├── openfort.ts # Openfort SDK configuration
│ └── assets/ # Static assets (logos, icons)
├── public/ # Public assets
├── package.json # Dependencies and scripts
└── README.md # Project documentationKey Features
- Openfort embedded wallet creation
- Solana transaction execution
- Cross-chain support (Solana ↔ EVM chains)
- Simple authentication flow
- Chain switching capabilities
| Component | Technology |
|---|---|
| Frontend | React + Vite |
| Blockchain | Solana (+ Polygon Amoy for chain switching) |
| Key Libraries | @openfort/openfort-js, @solana/web3.js |
| Styling | Tailwind CSS |
Quick Start
Download the Solana sample using gitpick:
pnpx gitpick openfort-xyz/openfort-js/tree/main/examples/apps/solana-sample
cd solana-sampleThis will download only the solana-sample directory without cloning the entire openfort-js monorepo.
Prerequisites
- Node.js 18+
- pnpm
- Openfort account with configured API keys
- Modern web browser
Configuration
-
Copy the environment template:
cp .env.example .env.local -
Add your Openfort credentials to
.env.local:VITE_OPENFORT_PUBLIC_KEY=your_public_key_here
Install & Run
pnpm install
pnpm run devHow It Works
The application demonstrates three core functionalities:
- User Creation: Creates a new Openfort user with embedded wallet support
- Solana Transactions: Executes transactions on the Solana blockchain using Openfort's signer
- Chain Switching: Demonstrates cross-chain capabilities by switching to Polygon Amoy (EVM chain)
This sample is ideal for developers looking to add Solana support to their applications while maintaining the flexibility to work with EVM-compatible chains.