NEXIS
Documentation

Developer Docs

Comprehensive documentation for integrating with the NEXIS Web3 Community OS platform.

Scroll
01

Getting Started

Welcome to the NEXIS Developer Documentation. This guide will help you integrate with the NEXIS Web3 Community OS platform, covering authentication, Discord integration, wallet connection, NFT verification, and API usage.

Prerequisites

  • Node.js 18+ or higher for server-side development
  • Next.js 14+ for frontend integration
  • TypeScript for type-safe development
  • MongoDB account for database integration
  • Discord Developer Account for bot integration
  • Web3 Wallet (MetaMask, Phantom, etc.) for testing

API Keys

To access NEXIS APIs, you'll need to obtain API credentials from your dashboard.

  • NEXIS API Key: Primary authentication key for API requests
  • Webhook Secret: For validating webhook signatures
  • Discord Bot Token: For Discord bot integration
  • Environment Variables: Store credentials securely

Quick Start

Get up and running with NEXIS integration in minutes.

  • Step 1: Create a NEXIS developer account
  • Step 2: Generate API keys from dashboard
  • Step 3: Install NEXIS SDK: npm install @nexis/sdk
  • Step 4: Configure environment variables
  • Step 5: Make your first API call
02

Authentication

NEXIS uses secure authentication mechanisms to protect API access and user data. All API requests require proper authentication using API keys or OAuth tokens.

API Key Authentication

Use your API key in the request header for authentication.

Authorization: Bearer YOUR_API_KEY

OAuth 2.0 Flow

NEXIS supports OAuth 2.0 for user authentication and authorization.

  • Authorization Code: Standard OAuth 2.0 authorization code flow
  • PKCE: Proof Key for Code Exchange for mobile apps
  • Token Refresh: Automatic token refresh mechanism
  • Scope Management: Granular permission scopes

Security Best Practices

  • Never expose keys: Store API keys in environment variables
  • Use HTTPS: All API calls must use HTTPS
  • Rotate keys: Regularly rotate API keys
  • Monitor usage: Track API usage for unusual activity
03

Discord Integration

Integrate Discord functionality into your application using NEXIS Discord APIs. This includes bot management, server administration, user authentication, and role synchronization.

Bot API

Control Discord bots through NEXIS APIs for moderation and management.

  • Bot Commands: Execute slash commands and custom commands
  • Moderation: Automate moderation actions and rules
  • Server Management: Manage Discord servers and channels
  • Role Management: Synchronize roles with holder tiers

OAuth Integration

Implement Discord OAuth for user authentication and identity linking.

  • User Authentication: Discord OAuth 2.0 flow
  • Identity Linking: Link Discord accounts to NEXIS users
  • Server Permissions: Validate server management permissions
  • Webhook Events: Receive Discord webhook events
04

Wallet Integration

Integrate Web3 wallet functionality for cryptographic verification and NFT ownership validation. NEXIS supports multiple wallet providers and blockchain networks.

Supported Wallets

  • MetaMask: Most popular Web3 wallet
  • WalletConnect: Mobile wallet integration
  • Phantom: Solana-native wallet
  • Other EVM Wallets: Coinbase Wallet, Trust Wallet

Signature Verification

Implement cryptographic signature verification for wallet ownership proof.

  • Challenge Generation: Generate unique verification challenges
  • Signature Request: Request wallet signature from users
  • Verification: Server-side signature validation
  • Recovery: Handle signature failures gracefully
05

NFT Verification

Verify NXAE NFT ownership to determine holder tiers and access control. The verification system integrates with blockchain providers to ensure accurate and up-to-date ownership data.

Verification Process

  • Query Blockchain: Query NFT ownership from blockchain
  • Count Holdings: Determine quantity of eligible NFTs
  • Apply Rules: Map holdings to tier configuration
  • Update Database: Record verification results
  • Sync Discord: Update Discord roles based on tier

Real-time Updates

Implement webhook handlers for real-time NFT ownership updates.

  • Transfer Events: Handle NFT transfer events
  • Automatic Re-verification: Trigger re-verification on changes
  • Tier Updates: Update holder tiers dynamically
  • Notifications: Send notifications for tier changes
06

Bot API

Control NEXIS Discord bots through comprehensive APIs for moderation, commands, and server management. The Bot API provides full control over bot behavior and configuration.

Bot Endpoints

  • POST /bot/install: Install bot to Discord server
  • GET /bot/status: Get bot operational status
  • POST /bot/configure: Configure bot settings
  • GET /bot/servers: List connected servers
  • POST /bot/command: Execute bot commands

Moderation API

Implement automated moderation through API endpoints.

  • Rule Management: Create and update moderation rules
  • Action Execution: Execute moderation actions
  • Log Access: Access moderation logs
  • Configuration: Configure thresholds and exemptions
07

Database Schema

NEXIS uses MongoDB as its primary database with a comprehensive schema designed for scalability and performance. Understanding the database structure is essential for advanced integrations.

Core Collections

  • users: User accounts and profiles
  • wallets: Connected wallet information
  • nft_holdings: NFT ownership records
  • holder_tiers: Tier configurations and assignments
  • bot_subscriptions: Subscription records
  • discord_servers: Connected Discord servers
  • predictions: Prediction market data
  • xp_transactions: XP ledger records

Indexes & Performance

Critical database indexes for optimal query performance.

  • Unique Indexes: User emails, Discord IDs, wallet addresses
  • Compound Indexes: User + timestamp, prediction + status
  • Geospatial Indexes: Location-based queries
  • Text Indexes: Full-text search capabilities
08

Security Best Practices

Security is paramount when integrating with NEXIS. Follow these best practices to ensure your integration is secure and compliant with industry standards.

API Security

  • Always use HTTPS: Never expose API keys in URLs
  • Validate Inputs: Sanitize all user inputs
  • Rate Limiting: Implement client-side rate limiting
  • Error Handling: Never expose sensitive data in errors

Data Protection

  • Encrypt at Rest: Encrypt sensitive data in database
  • Encrypt in Transit: Use TLS for all communications
  • Minimal Data: Only collect necessary user data
  • Retention Policies: Implement data retention policies
09

Webhooks

Use webhooks to receive real-time notifications about NEXIS events. Webhooks enable your application to react to changes in user data, subscription status, NFT ownership, and more.

Webhook Events

  • user.created: New user registration
  • subscription.updated: Subscription status changes
  • nft.verified: NFT ownership verification completed
  • tier.changed: Holder tier updated
  • prediction.settled: Prediction market settled

Webhook Security

  • Signature Verification: Verify webhook signatures
  • Idempotency: Handle duplicate webhook events
  • Retry Logic: Implement exponential backoff
  • Timestamp Validation: Reject old webhook events
10

Rate Limiting

NEXIS APIs implement rate limiting to ensure fair usage and system stability. Understanding rate limits is essential for building robust integrations.

Rate Limit Tiers

  • Free Tier: 100 requests/minute
  • Starter: 1,000 requests/minute
  • Pro: 10,000 requests/minute
  • Enterprise: Unlimited with custom limits

Headers & Responses

Rate limit information is included in response headers.

  • X-RateLimit-Limit: Request limit per window
  • X-RateLimit-Remaining: Remaining requests
  • X-RateLimit-Reset: Unix timestamp of reset
  • Retry-After: Seconds until retry (429 response)
11

Error Handling

Implement proper error handling to create robust integrations. NEXIS APIs use standard HTTP status codes and detailed error messages.

HTTP Status Codes

  • 200 OK: Request successful
  • 400 Bad Request: Invalid request parameters
  • 401 Unauthorized: Invalid or missing authentication
  • 403 Forbidden: Insufficient permissions
  • 404 Not Found: Resource not found
  • 429 Too Many Requests: Rate limit exceeded
  • 500 Internal Server Error: Server error

Error Response Format

{ "error": { "code": "INVALID_PARAMETER", "message": "Invalid wallet address format", "details": { "field": "wallet_address", "value": "invalid_address" } } }
12

Deployment

Deploy your NEXIS integration to production with confidence. Follow these guidelines for secure and scalable deployment.

Environment Configuration

  • Environment Variables: Store all secrets in environment variables
  • Production Keys: Use production API keys in production
  • Database Connection: Use production MongoDB instance
  • Logging: Enable comprehensive logging

Security Checklist

  • HTTPS Only: Force HTTPS in production
  • CORS Configuration: Configure CORS properly
  • Input Validation: Validate all inputs on server-side
  • Rate Limiting: Implement rate limiting
  • Monitoring: Set up error monitoring and alerts
NEXIS · Developer Documentation