Skip to main content

Package Installation

Install MagenX404 using your preferred package manager:
npm install magenx404

Framework-Specific Setup

Next.js

See the Next.js Setup Guide for detailed configuration.

React (Create React App)

No additional configuration needed. The package works out of the box.

Vue.js

No additional configuration needed. The package works out of the box.

Vanilla JavaScript

The package works in any JavaScript environment that supports ES modules.

Verify Installation

After installation, verify it works:
import { X404TimeLock } from "magenx404";

console.log(typeof X404TimeLock); // Should log "function"

TypeScript Support

The package includes full TypeScript definitions. If you’re using TypeScript, you’ll get:
  • Full IntelliSense support
  • Type checking
  • Auto-completion
import {
  X404TimeLock,
  X404Blacklist,
  X404MultiToken,
  X404Activity,
  X404Tier,
  X404NoDebt,
  X404Age,
} from "magenx404";
import { detectWallets, getGeolocationData } from "magenx404/utils";

// Full type safety and IntelliSense support!
const wallets = detectWallets(); // string[]
const location = await getGeolocationData(); // Promise<GeolocationData>
const result = await X404TimeLock({ ... }); // Promise<X404Result>

Package Structure

The package exports:
  • Features: Individual authentication features
  • Utilities: Helper functions for wallet detection, geolocation, etc.
  • Types: TypeScript type definitions
// Import features
import {
  X404Blacklist,
  X404TimeLock,
  X404MultiToken,
  X404Activity,
  X404Tier,
  X404NoDebt,
  X404Age,
} from "magenx404";

// Import utilities
import { detectWallets, getGeolocationData } from "magenx404/utils";

Troubleshooting

Module Not Found Errors

If you see module resolution errors:
  1. Clear cache and reinstall:
    rm -rf node_modules package-lock.json
    npm install
    
  2. For Next.js: Make sure transpilePackages is configured (see Next.js Setup)
  3. Restart your dev server

Type Errors

If TypeScript can’t find types:
  1. Make sure node_modules/magenx404 exists
  2. Check that your tsconfig.json includes the package:
    {
      "include": ["**/*", "node_modules/magenx404/**/*"]
    }
    

Build Errors

If you encounter build errors:
  1. Ensure you’re using a compatible Node.js version (18+)
  2. Check that all dependencies are installed
  3. Clear build cache and rebuild

Next Steps

Next.js Setup

Configure Next.js for MagenX404

Quick Start

Get started with your first authentication