Repository navigation
Conversation
This was referenced Oct 20, 2026
kartojal
force-pushed
the
feat/dev-750-platform-api-keys
branch
from
October 20, 2026 14:32
ce96ad2 to
3f44758
Compare
This was referenced Oct 20, 2026
kartojal
force-pushed
the
feat/dev-750-platform-api-keys
branch
from
October 20, 2026 16:16
3f44758 to
4c1fc7f
Compare
kartojal
force-pushed
the
feat/dev-750-platform-api-keys
branch
2 times, most recently
from
October 20, 2026 16:38
397bd13 to
75d9789
Compare
kartojal
force-pushed
the
feat/dev-750-platform-api-keys
branch
2 times, most recently
from
October 21, 2026 08:52
2186a39 to
b8e008c
Compare
kartojal
marked this pull request as ready for review
October 21, 2026 08:56
kartojal
force-pushed
the
feat/dev-750-platform-api-keys
branch
from
October 21, 2026 09:12
b8e008c to
459c54a
Compare
Merged
kartojal
force-pushed
the
feat/dev-750-platform-api-keys
branch
2 times, most recently
from
October 22, 2026 14:39
f22ced0 to
ccc5d62
Compare
kartojal
changed the base branch from
feat/dev-749-gateway-session
to
feat/predictions-action-routing
October 22, 2026 14:42
kartojal
force-pushed
the
feat/dev-750-platform-api-keys
branch
from
October 22, 2026 15:28
ccc5d62 to
0837ffd
Compare
kartojal
force-pushed
the
feat/dev-750-platform-api-keys
branch
2 times, most recently
from
October 26, 2026 08:28
81d703a to
974f81a
Compare
kartojal
force-pushed
the
feat/dev-750-platform-api-keys
branch
2 times, most recently
from
November 2, 2026 14:23
efd841e to
7cfdd2a
Compare
kartojal
force-pushed
the
feat/dev-750-platform-api-keys
branch
from
November 2, 2026 16:55
7cfdd2a to
4106448
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4106448. Configure here.
…helper Rename legacyApiKey to submissionApiKey, add createPlatformChallenge to the node entry point for backend challenge proxies, use camelCase in the proxy body, and drop the UserInputError aliases. Gasless actions now share one check that any bearer session satisfies. Move earlier-stack docs, changeset and test out of this PR.
Wallet submissions again require a builder or relayer API key. A bearer session alone is not a confirmed relayer credential. Requests without credentials keep their response and failure cause, and the protected transport reads the global fetch per request. Export error unions for the platform adapter factories. Fold the narrow request-error suite into the existing redaction tests and remove overlapping platform adapter cases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Predictions requests carry API-key headers only for the operations of the key's credential family, so the signing failure cases use the mapped order read instead of an unmapped path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kartojal
force-pushed
the
feat/dev-750-platform-api-keys
branch
from
November 3, 2026 17:52
281366d to
7a19092
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Adds server-only Platform API Key attribution and a browser-compatible challenge proxy on top of Predictions routing.
platformApiKeykeepsX-API-Keyon gateway requests.remotePlatformApiKeycalls the complete configured challenge URL, and the SDK signs and completes login directly. Refresh and logout use session credentials without another application key exchange. Existing builder and submission authorization remains available through the optionalsubmissionApiKeyadapter.Gasless actions (wallet deployment, gasless transactions, collateral return and session-key revocation) still require a builder or relayer API key, passed directly or as
submissionApiKey. The relayer does not list the Gateway Access Token as a/submitcredential, so a bearer session alone does not unlock them. The four actions reject a missing key withUserInputErrorbefore any signing.Saved L2 credentials migrate directly through
/v1/auth/migrate, even with a remote challenge adapter, without proxying the proof or asking for a new wallet signature. Remote challenge configuration adds no attribution to that migration. Use a serverplatformApiKeywhen platform attribution is required. All public session credentials remain plain bearer pairs.Requests that carry credentials have them redacted from errors, and submission
SigningErrorfailures keep their type while untrusted causes are removed. Requests without credentials keep their original response and failure cause. The protected transport reads the globalfetchper request, so a later patch offetch(MSW, tracing) still applies. The adapter factories exportPlatformApiKeyErrorandRemotePlatformApiKeyError.Rebased onto the current #463 head, including its credential-family signing scope. Gateway headers wrap the scoped API-key headers.
Inherits #437's setup-failure session revocation and deferred new-session credential notifications.
Stack: #442 → #481 → #437 → #463 → #438 → #441.
Validation on 2026-11-03: build, lint and workspace typecheck pass, and 1,128 client tests pass. The live integration suites for public reads pass against production, except the three base-branch failures noted in #463. Live production checks on the previous head covered signed login, automatic saved-L2 migration, authenticated reads, bearer restoration and refresh, and logout with rejected refresh reuse. No trading, transfers, approvals or wallet deployment were performed.
Human approval and outstanding review threads have not been resolved automatically.
Note
Medium Risk
Changes authentication header wiring, challenge routing, and error redaction on gateway and secure clients; mistakes could leak keys or break login, though behavior is heavily tested and builder adapters are unchanged.
Overview
Adds Platform API Key support so apps can bind gateway sessions to server-issued application identity without exposing secrets in the browser.
Server:
platformApiKey(from@polymarket/client/node) sendsX-API-Keyon Predictions gateway traffic (challenge, login, migrate, authenticated routes) while refresh and logout stay bearer-only. Browser:remotePlatformApiKeyPOSTs onlysigner/ optional wallet fields to a configured challenge URL; login, refresh, and logout still hit the gateway directly.createPlatformChallengeon the node entry supports backend challenge routes.The
apiKeyslot can now carry a platform adapter; existingbuilderApiKey/relayerApiKey/remoteBuilderSigningremain via optionalsubmissionApiKey. Gasless paths (deploy, gasless txs, collateral return, session-key revoke) still require submission credentials—platform attribution alone does not enable gasless.Login uses
requestOwnershipChallenge(gateway or proxycreateChallenge) instead of hard-coded challenge POSTs. Gateway headers are merged throughauthorizeGatewayon public and secure Predictions clients. Credential redaction and generic auth transport errors are tightened inprotectRequestErrors(includingSigningErrorpropagation throughServiceClient); requests without secrets pass through unchanged.New docs (
platform-api-keys.md) and binding types for ownership challenge requests; extensive contract tests and browser/node export boundaries.Reviewed by Cursor Bugbot for commit 7a19092. Bugbot is set up for automated code reviews on this repo. Configure here.