PlayDrop logoPlayDrop Studio
CreatePlayTradeEarnLearnConnectorsAssetsCommunitySupport
PlayDrop logoPlayDrop Studio
CreatePlayTradeEarnLearnConnectorsAssetsCommunitySupport
Sign in
Client SDK
Documentation

Start here

OverviewYour first gameHow to make a gamePlayDrop gamesAI game makers comparedFAQ

Create with Cloud

Cloud creationPlans & generations

Connect your AI app

All connectorsClaudeChatGPTClaude CodeCodexCursorGeminiAntigravityGrok BuildGrok BotGrok ChatLovableReplit

Publish and share

Publish from your AI appShare a ChatGPT gameShare a Claude gamePublish a browser gameSimple HTML gamesPackaging and .playPublish & importGame filesVisibility and reachListing art and videoGenres and tagsLocalizationInstant games

Game experience

Loading, pause and audioFull screen and safe areasCloud savesLocal parties and controllers

Play together

Turn gamesLeaderboard gamesOnline party gamesSharing, friends and invitesLeaderboardsAchievementsOnline parties and voiceRealtime game servers

Earn

MonetizationCredits & rewards

Assets

Game assetsAI asset generationCustom formats and player creations

Reference

Client SDKServer SDKcatalogue.jsonErrors and recoveryTroubleshooting
DocumentationClient SDK

Reference

PlayDrop client SDK reference

Reference for the PlayDrop browser SDK: host lifecycle, identity and saves, controllers, social, multiplayer, shop, ads, leaderboards, assets and AI.

Connect your AI app
Arrowbound@mnouz

The client SDK connects a browser game to PlayDrop's host on the website and in the apps. This page is a map of its namespaces; the linked guides explain when and how to use each one. The exact parameter and return types of every method, generated from the SDK's source declarations, are in the client SDK declarations and the shared types they use. AI apps read them with get_documentation topics sdk-types and shared-types.

Load and initialize

html
<script src="https://assets.playdrop.ai/sdk/playdrop.js"></script>
<script type="module">
  const sdk = await playdrop.init();
  // Read sdk.host state, subscribe, render the first frame, then:
  sdk.host.ready();
</script>

playdrop.init() resolves once with the SDK object below. Using the SDK requires a package; the simple HTML path refuses it. TypeScript declarations come with the playdrop-sdk-types package.

sdk.host

MemberPurpose
ready(), error(message?), editorReady()Signal the first playable frame, a fatal start error, or a ready game-owned Editor
phase, onPhaseChange(cb)preview, play or editor
mode, deployment, platform, sdkVersiondev/play, dev/live, web/native, SDK version
isPaused, onPause(cb), onResume(cb)Host pause with a reason
audioAllowed, onAudioAllowedChange(cb), audioEnabled, onAudioPolicyChange(cb)Whether the game may play sound
reservedCorners, onReservedCornersChange(cb)Host controls over the top corners, in CSS pixels
language, localePlayer language (20 languages; locale limited to the original 10)
share(options)Share the game's page with text, payload, image or video
launchPayload, launchFriendData from a shared link or card (read it first); the friend whose direct chat opened the game
showGames({ games }), preloadGame(ref)Recommend 1–3 other games; hint the next one
requestReview()Let PlayDrop ask for a review at a natural break

Guides: lifecycle, viewport, sharing, localization.

sdk.me

MemberPurpose
isLoggedIn, userId, usernameThe real PlayDrop account, if any
login(), promptLogin({ reason }), onAuthChange(cb)Ask the host to sign the player in, saying why; follow changes
appData, updateAppData(data)Cloud save snapshot and full-object write
selectedProfileAssetRef, getSelectedProfileAssetRef()The player's avatar asset

Games with authMode: "NONE" cannot ask for sign-in. Guide: cloud saves.

sdk.leaderboards and sdk.achievements

MemberPurpose
leaderboards.list(options?), get(key, { top, aroundMe }), submitScore(key, score)Declared boards, ranks and best scores
achievements.list(options?), get(key), unlock(key), setProgressAtLeast(key, total)Declared achievements and progress

Guides: leaderboards, achievements.

sdk.device and sdk.haptics

MemberPurpose
category, orientation, inputsdesktop/tablet/phone, orientation, keyboard/mouse/touch
enableControllerInput(), gamepad(playerIndex), onButton(cb)Physical and phone controllers
localPlayers, onLocalPlayersChange(cb)Local party slots
controllerAvailability, connectedGamepads, onControllerChange(cb)Controller inventory
haptics.supported, selection(), impact(style?), notification(type)Native vibration feedback

Guide: local parties and controllers.

sdk.social

MemberPurpose
selectFriends({ max }), listGameFriends()Pick friends; friends who play this game
sendMessage(input), getMessages(options?), consumeMessage(id)Game cards in PlayDrop Chat
openProfile(userId), openChat({ recipientUserId, draftMessage })Host profile and chat windows
openParty(options?), getParty(), onPartyChange(cb)Party window and membership

Guides: sharing, friends and invites, online parties.

sdk.multiplayer and sdk.connection

MemberPurpose
multiplayer.join(roomName, options?)Join a room of the game's server, using party seats when present
multiplayer.reconnect(roomName, token)Restore a reserved seat after a reload
multiplayer.getConnection(){ endpoint, token, expiresAt } for a raw Colyseus client
multiplayer.voice.updateSpatialState(state)Room voice volume and panning hints
connection.getStatus(), getQuality(), serverNow(), renderTime(), onStatusChange(cb), onQualityChange(cb)Compatibility clocks for older games; networking uses the Colyseus room

Guide: realtime game servers.

sdk.shop and sdk.ads

MemberPurpose
shop.purchase(payload)Buy a consumable or entitlement with credits; resolves an AUTHORIZED receipt
shop.consume(id), shop.grant(id), shop.cancel(id)Settle or cancel a receipt
shop.receipts(filters?), shop.onDeviceRestore purchases; offline-first host flag
ads.interstitial.load(), show()Interstitial ads
ads.rewarded.load(), show()Rewarded ads; reward only on completed

Guide: monetization.

sdk.assets and sdk.search

MemberPurpose
assets.resolveAppAsset(runtimeKey), listAppAssets()The game's declared assets and file URLs
assets.catalog (listPublic, listForCreator, get, listVersions, downloadFile, …), assets.packs, assets.models, assets.specs, assets.graphBrowse, read and manage assets, packs, 3D models, specs and relations
assets.custom.forSpec(ref)Player creations in a custom format
assets.tags.list(), tags.get(group, tag)Discovery tags
search.query(request)Search creators, games, assets and packs

Guides: game assets, custom formats, tags.

sdk.ai

ai.image, music, sfx, speech, video and model3d each have createTask(request) and generations(). ai.tasks has get, list, events, downloadFile, cancel and clear; ai.inputs.upload(blob) uploads a reference file. Media tasks ask the player to confirm a credit cost. ai.text and ai.json return app_ai_generation_disabled in hosted games; use the server SDK. Guide: AI asset generation.

sdk.libs, sdk.tweaks, sdk.creator and sdk.app

  • libs.three, phaser, rapier, nipplejs, colyseus and avatar: info() and load() return versions PlayDrop hosts and caches. Rapier's loader already initializes its WASM.
  • tweaks.get() reads creator-tunable values declared in the catalogue.
  • creator is non-null only for the game's owner: replaceTweaks(values) and notes (list, add, replace, remove) for playtest notes.
  • app describes the running game: name, displayName, version, authMode, surfaceTargets and more.

Errors and fallbacks

SDK calls reject with an Error whose message is a stable code, such as controller_input_timeout, host_share_video_unsupported or authentication_required. Keep the game playable when an optional service fails. Never call navigator.getGamepads(), bind Escape or the controller Menu button, or write progress outside the play phase. A readiness warning means an integration is missing; it does not prove the game behaves correctly, so test the uploaded game.

Related guides

  • Loading, pause and audioInitialize the PlayDrop SDK, signal ready at the first playable frame, pause and resume cleanly, follow the audio policy, and preload files for offline play.
  • Server SDKReference for PlayDrop-hosted game servers: runtime rules, the verified PlayDropPlayer, and the social, shop, ai and multiplayer server APIs.
  • catalogue.jsonThe catalogue.json fields PlayDrop games use: identity, listing, play modes, surfaces, sign-in, Instant, preloading, media, translations, scores and servers.

Real games on PlayDrop

  • Voxel Vice@olivier
  • Prompt Pursuit@olivier
  • Pals vs Zombies@olivier
  • Hollow Havoc@mnouz
  • Stellar Leap@mnouz
  • Rainbow Rabbit Run@newagekid52

Make games people want to play.

Create a gameConnect your AI app
PreviousCustom asset formats and player creations on PlayDropNextPlayDrop server SDK reference: Colyseus, MongoDB and @playdrop/server
View Markdown
EnglishFrançaisDeutsch日本語한국어EspañolPortuguês (Brasil)Bahasa Indonesia繁體中文简体中文ItalianoPolskiNederlandsSvenskaNorsk bokmålSuomiTürkçeไทยTiếng Việtالعربية

On this page

Load and initializesdk.hostsdk.mesdk.leaderboards and sdk.achievementssdk.device and sdk.hapticssdk.socialsdk.multiplayer and sdk.connectionsdk.shop and sdk.adssdk.assets and sdk.searchsdk.aisdk.libs, sdk.tweaks, sdk.creator and sdk.appErrors and fallbacks
View Markdown