PlayDrop logoPlayDrop Studio
CreatePlayTradeEarnLearnConnectorsAssetsCommunitySupport
PlayDrop logoPlayDrop Studio
CreatePlayTradeEarnLearnConnectorsAssetsCommunitySupport
Sign in
Sharing, friends and invites
Documentation

Start here

OverviewYour first gamePlayDrop gamesFAQ

Create with Cloud

Cloud creationPlans & generations

Connect your AI app

All connectorsClaudeChatGPTClaude CodeCodexCursorGeminiAntigravityGrok BuildGrok BotGrok ChatLovableReplit

Publish and share

Publish from your AI appSimple 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

Sharing, 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
DocumentationSharing, friends and invites
Play together

Sharing, friends and invites in PlayDrop games

Share a game with an image or clip, read launch payloads, pick friends, send invite and challenge cards in PlayDrop Chat, and recommend other games.

PlayDrop handles the share sheet, friend list and chat; your game asks for them at the right moment. Players bring their friends, and the friends land in your game.

Share the game

Call sdk.host.share() from a tap or click. It shares the game's public page with optional text, an image or a short video, and an optional launch payload.

js
shareButton.addEventListener("click", async () => {
  try {
    await sdk.host.share({ text: `I reached level ${level} in Moon Jump`, image: scoreCardBlob, payload: "level-7" });
  } catch (error) {
    console.warn("Share failed", error);
  }
});
  • image: a GIF, JPEG, PNG or WebP Blob up to 8 MiB. Hosts that cannot attach images share the link alone.
  • video: an MP4 Blob of at most 15 seconds and 20,000,000 bytes, instead of an image. H.264/AAC at 1080p in 16:9, 9:16 or 1:1 works best. Hosts without video support reject with host_share_video_unsupported rather than share a plain link.
  • Prepare the Blob before the tap; generating it after the tap can lose the browser's permission to share.
  • You cannot share a custom URL or other files. The link is always the game's page.

Image errors are invalid_host_share_image, host_share_image_type and host_share_image_too_large.

Read the launch payload

payload is up to 256 base64url characters. A player who opens the shared link starts the game with sdk.host.launchPayload set to it, or null. Treat it as untrusted input: validate it, and check on your server that the player may join a room it names. Never put credentials in it.

Pick friends and send game cards

sdk.social.selectFriends({ max }) opens PlayDrop's friend picker (1 to 10, default 1) and returns only the friends the player chose, or [] if they cancel. Then send a card that appears in PlayDrop Chat:

js
const [friend] = await sdk.social.selectFriends({ max: 1 });
if (friend) {
  await sdk.social.sendMessage({
    recipientUserId: friend.id,
    type: "challenge",
    title: "Beat my time: 42.3 s",
    subtitle: "Moon Jump, level 7",
    payload: "level-7",
    clientMessageId: `challenge-${runId}-${friend.id}`,
  });
}
  • type is invite, request, gift, challenge or turn.
  • title is up to 80 characters and subtitle up to 160.
  • expiresInSeconds is 60 seconds to 30 days (the default).
  • clientMessageId makes a retry safe: reusing it returns the original message.
  • You can message friends the player selected, friends who play this game, and players they already exchange game messages with. Strangers met in matchmaking cannot be messaged.

Read incoming cards with getMessages({ limit }), oldest first, then mark each handled with consumeMessage(message.id). The sender is message.from.id.

js
const page = await sdk.social.getMessages({ limit: 20 });
for (const message of page.messages) {
  await applyCard(message.type, message.from.id, message.payload);
  await sdk.social.consumeMessage(message.id);
}

Continue with cursor: page.nextCursor until it is null.

Friends who play this game

sdk.social.listGameFriends() returns friends with a recent session in this game: a good list for "play with" buttons. It does not expose the full friend list or presence. openProfile(userId) opens a player's profile and openChat({ recipientUserId, draftMessage }) opens Chat with an editable draft that the player sends themselves.

A new player who arrived from a friend may have sdk.host.launchFriend set. Offer to play with them and confirm with selectFriends({ max: 1 }); never start anything automatically.

Recommend other games

At a natural break, such as game over, sdk.host.showGames({ games: ["@creator/name"] }) shows PlayDrop cards for one to three other public games and pauses yours. It resolves played (PlayDrop then switches games) or dismissed. sdk.host.preloadGame(ref) hints at the game the player may open next.

Requirements

Sharing and social calls need a package that uses the SDK. Friends features need a signed-in player. Host-owned windows pause the game; handle pause and resume.

Related guides

  • Online parties and voiceLet friends play together online: declare party sizes, open PlayDrop's party window, join reserved rooms with sdk.multiplayer.join and control room voice.
  • Visibility and reachChoose who can open a PlayDrop game, how the account default and version publishing work, and how Boost, PlayTrade, Instant and search bring new players.
  • LeaderboardsDeclare leaderboards in catalogue.json, submit scores with sdk.leaderboards and show top ranks and the player's neighbors. Score types, limits and update rules.
PreviousLocal parties, gamepads and phone controllers in PlayDrop gamesNextLeaderboards for PlayDrop games
View Markdown
EnglishFrançaisDeutsch日本語한국어EspañolPortuguês (Brasil)Bahasa Indonesia繁體中文简体中文ItalianoPolskiNederlandsSvenskaNorsk bokmålSuomiTürkçeไทยTiếng Việtالعربية

On this page

Share the gameRead the launch payloadPick friends and send game cardsFriends who play this gameRecommend other gamesRequirements
View Markdown