BENTOTILESSDK DOCS

Getting Started

Quick start guide for embedding the BentoTiles SDK into your HTML5, WebGL, or AI-generated game.

BentoTiles Game SDK

The BentoTiles SDK is a zero-dependency, high-performance JavaScript library designed for game developers publishing on the BentoTiles web gaming platform.

Modeled after modern web gaming SDKs (like Poki and CrazyGames), it gives you simple APIs for:

  • 🎬 Commercial Mid-rolls & Rewarded Ads
  • ⏱️ Session & Loading Lifecycle Events
  • 💾 Cloud Saves & Player Progress Data
  • 🏆 Leaderboard Submissions
  • 👤 Player Profile & Authentication

🎮 Supported Game Engines & Workflow

We provide step-by-step guides for all major web game engines and AI coding workflows:

Engine / WorkflowDescriptionLink
🌐 Vanilla HTML5Plain JS, Canvas 2D, and WebGL gamesHTML5 Guide
🤖 AI Coding & PromptsBuild games using Cursor, Claude, ChatGPT, or AntigravityAI Prompts Guide
Phaser 3Popular 2D JavaScript & TypeScript game frameworkPhaser 3 Guide
🎮 Unity WebGLUnity 2020+ C# & .jslib bridge integrationUnity Guide
🚀 Godot 4Godot 4 GDScript Web export via JavaScriptBridgeGodot 4 Guide

⚡ Quick Start Snippet

Add this script tag to your game's index.html file before your main game scripts:

<script src="https://sdk.bentotiles.com/v1/bentotiles-sdk.js"></script>
<script>
  BentoTiles.init({ gameId: "your-game-slug" })
    .then(() => {
      console.log("BentoTiles SDK is Ready!");
      // Notify BentoTiles platform that your game preloader has finished
      BentoTiles.gameLoadingFinished();
    });
</script>

📦 Initialization Options

BentoTiles.init({
  gameId: "my-awesome-game", // Required: Your game slug on BentoTiles
  debug: true,                // Optional: Enable console RPC telemetry
  onPause: () => {
    // Automatically called when an ad break starts
    // Mute game audio and pause game loop here
  },
  onResume: () => {
    // Automatically called when an ad break completes
    // Unmute game audio and resume game loop here
  }
});

🛠️ Standalone Local Development

When you test your game on localhost or open index.html locally in a browser, the SDK automatically detects it is running outside of the BentoTiles host frame and activates Dev Mock Mode.

In Dev Mock Mode:

  • Ad calls display animated, simulated ad overlays so you can test pause/resume callbacks.
  • Cloud saves persist to browser localStorage.
  • Console logs display all SDK events in real-time.