Menu

1 / 8

How I built a real-money 1v1 SDK for web games

DEV Community·JS·6 months ago
#t9dommtF
#whats#webdev#javascript#game#three
Reading 0:00
15s threshold

What Challenge does

Devs drop a single <script> tag into their web game. Players match for $2 or $5, winner takes the pot, dev keeps 4.5% of every match. The button lives inside the host game — no separate app to download.

<script src= "https://api.withchallenge.com/widget/dist/challenge-widget.js" ></script>

Enter fullscreen mode

Exit fullscreen mode

Then:

Challenge . init ({ gameId : ' your-game-id ' , apiKey : ' sk_test_... ' , entryFee : 2 , onReady : handlePlayerReady , onError : ( err ) => console . error ( err ), });

Enter fullscreen mode

Exit fullscreen mode

~10 lines of code total. No backend changes if your game runs in the browser.

Three game modes

Different games decide winners differently, so the SDK supports three integration patterns:

SCORE — Each player plays solo. They submit a score. The platform compares and pays the higher one.

LIVE — Players play at the same time, with scores synced via WebSocket.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.