Skip to main content

Overview

The MagenX404 server handles authentication requests and verifies wallet signatures and token holdings. This guide will help you set up and run your own server instance.

Quick Start

1. Install Dependencies

2. Configure Environment Variables

Create a .env file in the project root:
Change JWT_SECRET to a secure random string in production!

3. Start the Server

Or for development with auto-reload:
The server will start on http://localhost:3000

Environment Variables

number
Port number for the server (default: 3000)
string
required
Secret key for signing JWT tokens. Generate a secure random string for production.
string
JWT token expiration time (default: “30d”)
string
required
Solana RPC endpoint URL. Use a dedicated provider for production.

Generate Secure JWT Secret

Testing the Server

Health Check

Expected response:

Test Nonce Generation

You should receive a response with X-404-Nonce header.

Updating Client Code

To use your local server instead of the hosted one, update the URLs in the feature files:

Server Structure

API Endpoints

All endpoints are available at /x404_auth/{feature}:
  • /x404_auth/blacklist - Blacklist feature
  • /x404_auth/timelock - TimeLock feature
  • /x404_auth/multitoken - MultiToken feature
  • /x404_auth/activity - Activity feature
  • /x404_auth/tier - Tier feature
  • /x404_auth/nodebt - NoDebt feature
  • /x404_auth/age - Age feature

Next Steps

Deployment Guide

Learn how to deploy your server to production