# API Reference
Source: https://docs.moongate.one/authentication/moongate-adapter/api-reference
Complete reference for all Moongate Adapter hooks, components, and configuration options.
## Hooks
### useWallet()
The primary hook for accessing wallet state and methods.
```tsx theme={null}
import { useWallet } from '@moongate/sdk';
const { connected, publicKey, disconnect, connecting } = useWallet();
```
#### Returns
Whether a wallet is currently connected
The connected wallet's public key, or null if not connected
Function to disconnect the current wallet
Whether a wallet connection is currently in progress
The currently connected wallet adapter instance
#### Example Usage
```tsx theme={null}
function WalletStatus() {
const { connected, publicKey, disconnect, connecting } = useWallet();
if (connecting) return
Connecting...
;
if (connected) {
return (
Connected: {publicKey?.toString().slice(0, 8)}...
);
}
return
Not connected
;
}
```
### useConnection()
Hook for accessing the Solana connection instance.
```tsx theme={null}
import { useConnection } from '@moongate/sdk';
const { connection } = useConnection();
```
#### Returns
The Solana connection instance for making RPC calls
### useWalletModal()
Hook for controlling the wallet selection modal.
```tsx theme={null}
import { useWalletModal } from '@moongate/sdk';
const { visible, setVisible } = useWalletModal();
```
#### Returns
Whether the wallet modal is currently visible
Function to show or hide the wallet modal
#### Example Usage
```tsx theme={null}
function CustomConnectButton() {
const { connected } = useWallet();
const { setVisible } = useWalletModal();
if (connected) return null;
return (
);
}
```
## Components
### MoongateConnectButton
The main connect button component (recommended for most use cases).
```tsx theme={null}
import { MoongateConnectButton } from '@moongate/sdk';
```
#### Props
Custom button text or content
Additional CSS classes to apply
Inline styles to apply
#### Example Usage
```tsx theme={null}
// Basic usage
// With custom text
Connect to Solana
// With custom styling
Connect Wallet
```
### WalletConnectButton
Individual wallet connect button for specific wallets.
```tsx theme={null}
import { WalletConnectButton } from '@moongate/sdk';
```
#### Props
Name of the specific wallet to connect to
Custom button content
#### Example Usage
```tsx theme={null}
// Connect to specific wallet
```
## 📱 Mobile Considerations
The Adapter is fully responsive and mobile-optimized:
* Touch-friendly wallet selection
* Mobile wallet deep linking
* Responsive modal sizing
* iOS/Android wallet app integration
## 🆘 Need Help?
* 📧 Email: [amen@moongate.one](mailto:amen@moongate.one) or [praneet@moongate.one](mailto:praneet@moongate.one)
* 💬 Telegram: [@and\_its\_praneet](https://t.me/and_its_praneet)
* 🐛 Issues: Message us on [web.moongate.one](https://web.moongate.one)
# Moongate Adapter Overview
Source: https://docs.moongate.one/authentication/moongate-adapter/overview
The Moongate Adapter is a beautiful, customizable Solana wallet adapter
## 🚀 Key Features
* 🎨 **Fully Customizable** - Brand colors, logo, and wallet selection
* 🔌 **30+ Wallet Support** - Phantom, Solflare, WalletConnect, Ledger, and more
* 💼 **TypeScript First** - Full type safety out of the box
* 🎯 **Modern UI** - Built with shadcn/ui components
* ⚡ **Zero Style Conflicts** - Advanced CSS scoping prevents interference
## ⚡ Quick Start
Get up and running in just 2 simple steps:
Get your API key from the partner dashboard
Complete setup guide for Create React App, Vite, and other React applications
## 📚 Documentation
Complete reference for hooks, components, and configuration options
Common issues and solutions
## 🎉 What You Get
The Moongate Adapter handles everything for you:
* ✅ Wallet detection and connection
* ✅ Transaction signing
* ✅ Network switching
* ✅ Error handling
* ✅ Mobile responsiveness
* ✅ Accessibility
## 🆘 Need Help?
* 📧 Email: [amen@moongate.one](mailto:amen@moongate.one) or [praneet@moongate.one](mailto:praneet@moongate.one)
* 💬 Telegram: [@and\_its\_praneet](https://t.me/and_its_praneet)
* 🐛 Issues: Message us on [web.moongate.one](https://web.moongate.one)
# Integration Guide
Source: https://docs.moongate.one/authentication/moongate-adapter/react
Complete integration guide for Create React App, Vite, and other React applications.
Make sure you've completed the [setup guide](/authentication/moongate-sdk/setup) before proceeding.
## 📦 Installation
First, install the Moongate Adapter in your React project:
**Using npm:**
```bash theme={null}
npm install @moongate/sdk
```
**Using yarn:**
```bash theme={null}
yarn add @moongate/sdk
```
## 🚀 Quick Setup (1 minute)
Simply wrap your app with MoonGateProvider and add the connect button:
```tsx src/App.tsx theme={null}
import React from 'react';
import { MoonGateProvider, MoongateConnectButton } from '@moongate/sdk';
import '@moongate/sdk/styles.css';
function App() {
return (
);
}
export default App;
```
## 🎉 You're Done!
Your React application now has full Solana wallet integration! The Moongate Adapter automatically handles:
* ✅ Wallet detection and connection
* ✅ Transaction signing
* ✅ Network switching
* ✅ Error handling
* ✅ Mobile responsiveness
## 📖 Next Steps
Explore all available hooks and components
Common integration issues
## 🆘 Need Help?
* 📧 Email: [amen@moongate.one](mailto:amen@moongate.one) or [praneet@moongate.one](mailto:praneet@moongate.one)
* 💬 Telegram: [@and\_its\_praneet](https://t.me/and_its_praneet)
* 🐛 Issues: Message us on [web.moongate.one](https://web.moongate.one)
# Setup
Source: https://docs.moongate.one/authentication/moongate-adapter/setup
Get your API key from the partner dashboard.
## Get Your API Key
### Create Your Account
1. Visit [partner.moongate.one](https://partner.moongate.one)
2. Create an account and wait for the admins to assign you to get your API key
3. Click on API Keys and generate one
## Next Steps
Once you have your API key, continue with the [integration guide](/authentication/moongate-sdk/react) to complete your setup.
## 🆘 Need Help?
* 📧 Email: [amen@moongate.one](mailto:amen@moongate.one) or [praneet@moongate.one](mailto:praneet@moongate.one)
* 💬 Telegram: [@and\_its\_praneet](https://t.me/and_its_praneet)
* 🐛 Issues: Message us on [web.moongate.one](https://web.moongate.one)
# Troubleshooting
Source: https://docs.moongate.one/authentication/moongate-adapter/troubleshooting
Common issues and solutions for Moongate Adapter integration.
## 🔧 Installation Issues
### Package Not Found
**Problem**: `npm install @moongate/sdk` fails with "package not found"
**Solutions**:
* Verify you have internet connection
* Clear npm cache: `npm cache clean --force`
* Try with yarn: `yarn add @moongate/sdk`
* Check if you're behind a corporate firewall
```bash theme={null}
# Clear npm cache and retry
npm cache clean --force
rm -rf node_modules package-lock.json
npm install
```
### TypeScript Errors
**Problem**: TypeScript compilation errors with Moongate Adapter
**Solutions**:
* Ensure you're using TypeScript 4.0+
* Add type declarations if needed
* Check your `tsconfig.json` configuration
```json tsconfig.json theme={null}
{
"compilerOptions": {
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"jsx": "react-jsx"
}
}
```
## 🔑 API Key Issues
### Invalid API Key
**Problem**: "Invalid API key" error when using the Adapter
**Solutions**:
* Verify your API key is correct (no extra spaces)
* Check if your account is approved in the partner dashboard
* Ensure you're using the right environment (dev/prod)
```tsx theme={null}
// Correct API key usage
{children}
```
## 🆘 Need Help?
* 📧 Email: [amen@moongate.one](mailto:amen@moongate.one) or [praneet@moongate.one](mailto:praneet@moongate.one)
* 💬 Telegram: [@and\_its\_praneet](https://t.me/and_its_praneet)
* 📞 Schedule a call: [Book a call with Praneet](https://calendly.com/moongate-founders/30min)
* 🐛 Issues: Message us on [web.moongate.one](https://web.moongate.one)
# API Reference
Source: https://docs.moongate.one/authentication/moongate-wallet/api-reference
Complete API reference for Inject Moongate Wallet
## registerMoonGateWallet
Registers a new Moongate wallet adapter with the specified configuration.
```typescript theme={null}
function registerMoonGateWallet(config: MoongateWalletConfig): void
```
### Parameters
| Parameter | Type | Required | Default | Description |
| --------- | ---------------------- | -------- | ------- | ----------------------------------- |
| `config` | `MoongateWalletConfig` | Yes | - | Configuration object for the wallet |
### MoongateWalletConfig
```typescript theme={null}
interface MoongateWalletConfig {
authMode: 'Google' | 'Apple' | 'Ethereum' | 'Twitter';
logoDataUri?: string;
position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
buttonLogoUri?: string;
environment?: 'production' | 'staging' | 'development';
displayState?: 'fullscreen' | 'minimized' | 'hidden';
}
```
### Example
```typescript theme={null}
import { registerMoonGateWallet } from '@moongate/moongate-adapter';
registerMoonGateWallet({
authMode: 'Google',
environment: 'production',
position: 'top-right',
displayState: 'fullscreen'
});
```
## 🆘 Need Help?
* 📧 Email: [amen@moongate.one](mailto:amen@moongate.one) or [praneet@moongate.one](mailto:praneet@moongate.one)
* 💬 Telegram: [@and\_its\_praneet](https://t.me/and_its_praneet)
* 🐛 Issues: Message us on [web.moongate.one](https://web.moongate.one)
# Installation Guide
Source: https://docs.moongate.one/authentication/moongate-wallet/installation
Step-by-step installation guide for Inject Moongate Wallet
# Installation Guide
## Prerequisites
Before installing Inject Moongate Wallet, ensure you have the following:
* **Node.js**: Version 16 or higher
* **React**: Version 18 or higher
* **Solana Web3.js**: Latest version
* **Solana Wallet Adapter packages**: Required for integration
## Installation Methods
### Using npm
```bash theme={null}
npm install @moongate/moongate-adapter
```
### Using yarn
```bash theme={null}
yarn add @moongate/moongate-adapter
```
### Using pnpm
```bash theme={null}
pnpm add @moongate/moongate-adapter
```
## Required Dependencies
Inject Moongate Wallet requires several peer dependencies. Install them alongside the adapter:
```bash theme={null}
# Core Solana packages
npm install @solana/wallet-adapter-base @solana/wallet-adapter-react @solana/wallet-adapter-react-ui @solana/web3.js
# Wallet Standard packages
npm install @solana/wallet-standard-features @solana/wallet-standard-chains @solana/wallet-standard-util
# Wallet Standard base packages
npm install @wallet-standard/app @wallet-standard/base @wallet-standard/wallet @wallet-standard/features
# Additional utilities
npm install bs58
```
## Package.json Dependencies
Your `package.json` should include these dependencies:
```json theme={null}
{
"dependencies": {
"@moongate/moongate-adapter": "^1.0.0",
"@solana/wallet-adapter-base": "^0.9.23",
"@solana/wallet-adapter-react": "^0.15.35",
"@solana/wallet-adapter-react-ui": "^0.9.35",
"@solana/web3.js": "^1.91.8",
"@solana/wallet-standard-features": "^1.2.0",
"@solana/wallet-standard-chains": "^1.1.0",
"@solana/wallet-standard-util": "^1.1.1",
"@wallet-standard/app": "^1.0.1",
"@wallet-standard/base": "^1.0.1",
"@wallet-standard/wallet": "^1.0.1",
"@wallet-standard/features": "^1.0.1",
"bs58": "^6.0.0"
}
}
```
## TypeScript Support
Inject Moongate Wallet includes full TypeScript support. If you're using TypeScript, no additional type definitions are required.
### TypeScript Configuration
Ensure your `tsconfig.json` includes the necessary compiler options:
```json theme={null}
{
"compilerOptions": {
"target": "ES2020",
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"module": "ESNext",
"skipLibCheck": true,
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"jsx": "react-jsx",
"strict": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true
}
}
```
## Verification
After installation, verify that everything is working correctly:
1. **Check package installation**:
```bash theme={null}
npm list @moongate/moongate-adapter
```
2. **Verify peer dependencies**:
```bash theme={null}
npm list @solana/wallet-adapter-base @solana/wallet-adapter-react
```
3. **Test import**:
```typescript theme={null}
import { registerMoonGateWallet } from '@moongate/moongate-adapter';
console.log('Inject Moongate Wallet imported successfully');
```
## Next Steps
Once installation is complete, proceed to:
* [Quick Start Guide](/authentication/moongate-adapter/quick-start) - Get up and running in minutes
* [Configuration Options](/authentication/moongate-adapter/configuration) - Customize Inject Moongate Wallet
* [API Reference](/authentication/moongate-adapter/api-reference) - Explore all available methods
## Troubleshooting Installation
### Common Issues
#### Peer Dependency Warnings
If you see peer dependency warnings, install the missing packages:
```bash theme={null}
npm install --save-dev @types/react @types/react-dom
```
#### Version Conflicts
If you encounter version conflicts, try using exact versions:
```bash theme={null}
npm install @moongate/moongate-adapter@1.0.0 --save-exact
```
#### TypeScript Errors
If you see TypeScript errors, ensure you have the latest version of the Solana packages:
```bash theme={null}
npm update @solana/wallet-adapter-base @solana/wallet-adapter-react
```
## 🆘 Need Help?
* 📧 Email: [amen@moongate.one](mailto:amen@moongate.one) or [praneet@moongate.one](mailto:praneet@moongate.one)
* 💬 Telegram: [@and\_its\_praneet](https://t.me/and_its_praneet)
* 🐛 Issues: Message us on [web.moongate.one](https://web.moongate.one)
# Moongate Wallet Overview
Source: https://docs.moongate.one/authentication/moongate-wallet/overview
Complete documentation for Inject Moongate Wallet - a Solana wallet adapter with social login support
## Overview
Inject Moongate Wallet is a Solana wallet adapter that provides seamless authentication and wallet functionality through various social login methods. It integrates with the Solana Wallet Standard and supports multiple authentication providers including Google, Apple, Twitter, and Ethereum.
## Installation
### Prerequisites
* Node.js 16+
* React 18+
* Solana Web3.js
* Solana Wallet Adapter packages
### Install Dependencies
```bash theme={null}
# Install Inject Moongate Wallet
npm install @moongate/moongate-adapter
# Install required Solana wallet adapter packages
npm install @solana/wallet-adapter-base @solana/wallet-adapter-react @solana/wallet-adapter-react-ui @solana/web3.js
```
### Package Dependencies
Inject Moongate Wallet requires the following peer dependencies:
```json theme={null}
{
"@moongate/solana-wallet-sdk": "^3.3.4",
"@solana/wallet-standard-features": "^1.2.0",
"@solana/wallet-standard-chains": "^1.1.0",
"@solana/wallet-standard-util": "^1.1.1",
"@wallet-standard/app": "^1.0.1",
"@wallet-standard/base": "^1.0.1",
"@wallet-standard/wallet": "^1.0.1",
"@wallet-standard/features": "^1.0.1",
"bs58": "^6.0.0",
"@solana/web3.js": "^1.91.8"
}
```
## Wallet Registration
### Basic Registration
```typescript theme={null}
import { registerMoonGateWallet } from '@moongate/moongate-adapter';
// Register with Google authentication
registerMoonGateWallet({
authMode: 'Google',
environment: 'production',
});
// Register with Apple authentication
registerMoonGateWallet({
authMode: 'Apple',
environment: 'production',
});
// Register with Ethereum authentication
registerMoonGateWallet({
authMode: 'Ethereum',
environment: 'production',
});
registerMoonGateWallet({
authMode: 'Twitter',
environment: 'production',
});
```
### Configuration Options
| Parameter | Type | Default | Description |
| --------------- | -------- | ---------------------------------------- | ----------------------------------------------------------------------- |
| `authMode` | `string` | `'Google'` | Authentication provider ('Google', 'Apple', 'Ethereum', 'Twitter') |
| `logoDataUri` | `string` | `'Default'` | Custom logo data URI for the wallet |
| `position` | `string` | `'top-right'` | Modal position ('top-right', 'top-left', 'bottom-right', 'bottom-left') |
| `buttonLogoUri` | `string` | `'https://i.ibb.co/NjxF2zw/Image-3.png'` | Button logo URI |
| `environment` | `string` | `'production'` | Environment ('production', 'staging', 'development') |
| `displayState` | `string` | `undefined` | Display state ('fullscreen', 'minimized', 'hidden') |
### Example Configuration
```typescript theme={null}
registerMoonGateWallet({
authMode: 'Google',
logoDataUri: 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTcxIiBoZWlnaHQ9IjE3MyI...',
position: 'top-right',
buttonLogoUri: 'https://your-custom-logo.com/logo.png',
environment: 'staging',
displayState: 'fullscreen',
});
```
## 🆘 Need Help?
* 📧 Email: [amen@moongate.one](mailto:amen@moongate.one) or [praneet@moongate.one](mailto:praneet@moongate.one)
* 💬 Telegram: [@and\_its\_praneet](https://t.me/and_its_praneet)
* 🐛 Issues: Message us on [web.moongate.one](https://web.moongate.one)
# Troubleshooting
Source: https://docs.moongate.one/authentication/moongate-wallet/troubleshooting
Common issues and solutions for Inject Moongate Wallet
# Troubleshooting
## Common Issues
### Wallet Not Appearing in Modal
**Problem**: The Moongate wallet doesn't appear in the wallet selection modal.
**Possible Causes**:
* Wallet not registered before WalletProvider initialization
* Incorrect wallet name used in select()
* Missing peer dependencies
**Solutions**:
1. **Ensure proper registration order**:
```typescript theme={null}
// ✅ Correct - Register before app initialization
import { registerMoonGateWallet } from '@moongate/moongate-adapter';
registerMoonGateWallet({
authMode: 'Google',
environment: 'production'
});
// Then initialize your app
ReactDOM.render(, document.getElementById('root'));
```
2. **Check wallet names**:
```typescript theme={null}
// ✅ Correct wallet names
select('Sign in with Google');
select('Sign in with Apple');
select('Ethereum Wallet');
select('Sign in with Twitter');
```
3. **Verify peer dependencies**:
```bash theme={null}
npm list @solana/wallet-adapter-base @solana/wallet-adapter-react
```
### Authentication Fails
**Problem**: Users can't authenticate with their social accounts.
**Possible Causes**:
* Incorrect environment configuration
* Missing API keys or configuration
* Network connectivity issues
* Browser compatibility issues
**Solutions**:
1. **Check environment configuration**:
```typescript theme={null}
// For development
registerMoonGateWallet({
authMode: 'Google',
environment: 'development'
});
// For production
registerMoonGateWallet({
authMode: 'Google',
environment: 'production'
});
```
2. **Verify browser compatibility**:
* Ensure you're using a modern browser
* Check if popup blockers are enabled
* Verify third-party cookies are allowed
3. **Check network connectivity**:
```typescript theme={null}
// Test network connectivity
fetch('https://api.moongate.one/health')
.then(response => console.log('Network OK'))
.catch(error => console.error('Network error:', error));
```
## 🆘 Need Help?
* 📧 Email: [amen@moongate.one](mailto:amen@moongate.one) or [praneet@moongate.one](mailto:praneet@moongate.one)
* 💬 Telegram: [@and\_its\_praneet](https://t.me/and_its_praneet)
* 📞 Schedule a call: [Book a call with Praneet](https://calendly.com/moongate-founders/30min)
* 🐛 Issues: Message us on [web.moongate.one](https://web.moongate.one)
# Enter the MoonGate
Source: https://docs.moongate.one/introduction
Make your Solana dApp accessible to anyone in just a few steps. With MoonGate's Adapter, with just a few lines of code you can enable Ethereum, Apple, Google & X users on your dApp.
## Moongate Adapter
### Get started with the Moongate Adapter in minutes
Get your wallet integration up and running in just 3 minutes with the Moongate Adapter for Next.js and React applications.
## 🆘 Need Help?
* 📧 Email: [amen@moongate.one](mailto:amen@moongate.one) or [praneet@moongate.one](mailto:praneet@moongate.one)
* 💬 Telegram: [@and\_its\_praneet](https://t.me/and_its_praneet)
* 📞 Schedule a call: [Book a call with Praneet](https://calendly.com/moongate-founders/30min)
* 🐛 Issues: Message us on [web.moongate.one](https://web.moongate.one)