Skip to main content

🚧 Coming Soon

This tutorial is part of the early developer preview for Gx402.
The SDK and its purchase functionality are still in active development — expect updates, new APIs, and improved stability soon.

Hello World with Gx402

In this quick tutorial, you’ll create your first application using the Gx402 SDK.
We’ll build a simple “game” that demonstrates the core idea behind x402-powered in-game purchases.

What You’ll Build

A small web page with a single button that lets players buy a Legendary Sword using Gx402 payment functionality.
This example focuses on the core purchase flow, keeping things as minimal as possible.

Prerequisites

Before you start, make sure you have:
  • 🧠 Basic knowledge of JavaScript and HTML
  • 💻 Node.js and npm installed
  • 🔑 (Optional) Your Gx402 API key from the Gx402 Dashboard

Step 1: Set Up Your Project

Let’s start fresh.
mkdir Gx402-purchase-example
cd Gx402-purchase-example
npm init -y
npm install @Gx402/sdk