Skip to content

Host a new lobby from a poki.com link carrying gdhost - #6104

Merged
evanpelle merged 1 commit into
mainfrom
feat/poki-host-link
Oct 24, 2026
Merged

evanpelle merged 1 commit into
mainfrom
feat/poki-host-link

Conversation

@evanpelle

Copy link
Copy Markdown
Collaborator

Summary

A poki.com link carrying gdhost now opens OpenFront on Poki straight into hosting a new lobby, like CrazyGames' instant multiplayer:

https://poki.com/en/g/openfront?gdhost=1
https://poki.com/en/preview/<game-id>/<version-id>?gdhost=1   (before launch)

Poki passes gd-prefixed params on its page down to our frame, and PokiSDK.getURLParam("host") reads them. PokiSDK.isInstantMultiplayer() now returns true for one, and Main.handleUrl already opens the host modal when it does (it always returned false before). If the link also carries an invite (gdgameId), the player joins that lobby instead.

Poki has no invite button or instant-multiplayer API of its own; shareableURL/getURLParam are its only sharing primitives (developers.poki.com/guide/sdk-html5).

Reloads: keepPokiParams already drops gd params from the query it restores, so navigating inside our frame (e.g. back home after a game) doesn't host another lobby. Reloading the whole poki.com page keeps the param and hosts a fresh one.

Test plan

  • PokiSDK.test.ts: gdhost → hosts; gdhost + gdgameId → doesn't; off Poki → false.
  • npx vitest tests/client/PokiSDK.test.ts tests/client/MainInitialize.test.ts (45 passed), oxfmt --check.
  • Poki preview: deployed to poki.openfront.dev; open a preview of a version that frames it, with ?gdhost=1.

🤖 Generated with Claude Code

A link like poki.com/en/g/openfront?gdhost=1 now opens OpenFront on Poki
straight into hosting a new lobby, the way CrazyGames' instant
multiplayer does: PokiSDK.isInstantMultiplayer() reads the param through
getURLParam, and Main.handleUrl already opens the host modal for it. An
invite (gdgameId) on the same link still joins instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 15437751-a503-495f-badf-37071e88af07
📥 Commits

Reviewing files that changed from the base of the PR and between 616eff6 and bf9075a.

📒 Files selected for processing: 3
  • src/client/Main.ts
  • src/client/PokiSDK.ts
  • tests/client/PokiSDK.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

Walkthrough

PokiSDK now detects instant multiplayer host links when the SDK is ready, except when a gameId is present. Main retains the host-modal behavior and changes the log label from CrazyGames to Portal. Tests cover host links, invite links, and off-Poki behavior.

Changes

Portal instant multiplayer

Layer / File(s) Summary
Detect and handle Portal links
src/client/PokiSDK.ts, src/client/Main.ts, tests/client/PokiSDK.test.ts
isInstantMultiplayer() now checks SDK readiness and URL parameters. It returns false when the SDK is unavailable or gameId is present; otherwise, it returns whether host is truthy. Main changes the log label to Portal and still opens the host modal when instant multiplayer is enabled. Tests cover host links, invite links, and the off-Poki case.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant BrowserURL
  participant PokiSDK
  participant Main
  participant HostModal
  Main->>PokiSDK: check instant multiplayer status
  PokiSDK->>BrowserURL: read host and gameId parameters
  PokiSDK-->>Main: return status
  Main->>HostModal: open when instant multiplayer is enabled
Loading

Possibly related PRs

Suggested reviewers: celant

Merge Risk: ⚪ Minimal · up to bf907

No actionable merge-blocking risk remains from the reviewed changes.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly summarizes the main change: hosting a new lobby from a Poki link carrying the gdhost parameter.
Description check Passed The description directly explains the Poki hosting behavior, invite precedence, parameter handling, and test validation.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 3 files.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches: 💡 1
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A host link arrives with host in view
PokiSDK checks that the SDK is ready
A gameId sends hosting aside
Main opens the modal when host status is true
Portal names the flow in the log
Tests check each path along the way

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

🤖 Claude Code Review

Verdict: Looks good. Findings: 0 critical, 0 major, 0 minor.

No issues found. Checked for bugs and CLAUDE.md compliance.

  • PokiSDK.isInstantMultiplayer() works the same way as CrazyGamesSDK.isInstantMultiplayer(). It waits for SDK readiness and lets an invite (gameId) win over hosting. On the invite path, Main.handleUrl returns early before it checks for instant multiplayer, so the two can't conflict.
  • The new tests are in tests/client/, so they run under jsdom. The off-Poki case is covered.

@evanpelle evanpelle added this to the v36 milestone Oct 24, 2026
@evanpelle
evanpelle merged commit 5dfd437 into main Oct 24, 2026
21 of 22 checks passed
@evanpelle
evanpelle deleted the feat/poki-host-link branch October 24, 2026 00:06
@github-project-automation github-project-automation Bot moved this from Triage to Complete in OpenFront Release Management Oct 24, 2026

This branch was successfully deployed

2 active deployments
backport — bf9075a1 Deployed Oct 24, 2026 by evanpelle via Cherry-pick #569
staging — bf9075a1 Deployed Oct 23, 2026 by openfrontio[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

1 participant