Skip to content

Claude Skills for integrating and working with the Play.fun ecosystem

Notifications You must be signed in to change notification settings

playdotfun/skills

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

Play.fun Skills for Claude Code

Best practices, references, and templates for integrating games with the Play.fun ecosystem.

What is Play.fun?

Play.fun is a platform for integrating games with Web3 rewards. Games can register on Play.fun, track player points, and launch Playcoins (game-specific Solana tokens) that reward players based on their gameplay.

Installation

npx skills add OpusGameLabs/skills

Skill Contents

Topic Description
API Reference Complete API endpoint reference
API Authentication HMAC-SHA256 authentication guide
Server SDK Server SDK reference (recommended for production)
Browser SDK Browser SDK reference (for prototypes)
Hybrid SDK Combined Server + Browser approach
SDK Best Practices Security, validation, and SDK selection
MCP Quickstart MCP server setup for AI assistants
Glossary Play.fun terminology and concepts

Deployment

Guide Description
GitHub Pages Deploy Deploy games to GitHub Pages for free hosting

Code Snippets

Snippet Description
Server SDK Snippets Express.js, Next.js, session validation examples
Browser SDK Snippets Vanilla JS, React, Phaser 3 examples

SDK Selection Guide

Scenario Recommended SDK
Production game with token rewards Server SDK
Games where cheating prevention matters Server SDK
Security + Play.fun widget Hybrid (Server + Browser)
Quick prototype / demo Browser SDK
Game jam entry Browser SDK

Quick Start

Server SDK (Recommended)

import { OpenGameClient } from '@playdotfun/server-sdk';

const client = new OpenGameClient({
  apiKey: process.env.OGP_API_KEY!,
  secretKey: process.env.OGP_API_SECRET_KEY!,
});

await client.play.savePoints({
  gameId: 'your-game-uuid',
  playerId: 'player-123',
  points: 100,
});

Browser SDK (Prototypes)

<meta name="x-ogp-key" content="YOUR_API_KEY" />
<script src="https://sdk.play.fun"></script>
<script>
  let sdk = null;
  let sdkReady = false;

  if (typeof OpenGameSDK !== 'undefined') {
    sdk = new OpenGameSDK({
      ui: { usePointsWidget: true },
      logLevel: 1,
    });

    sdk.on('OnReady', () => {
      sdkReady = true;
    });

    sdk.on('SavePointsSuccess', () => console.log('Saved!'));
    sdk.on('SavePointsFailed', () => console.log('Failed'));

    sdk.init({ gameId: 'your-game-uuid' });
  }

  // During gameplay:
  // if (sdk && sdkReady) sdk.addPoints(10);
  //
  // At game over:
  // if (sdk && sdkReady) sdk.savePoints(totalScore);
</script>

Resources

License

MIT

About

Claude Skills for integrating and working with the Play.fun ecosystem

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •