Repository navigation
Let TikTok Shop connectors use a server-level app and App Store installs - #1535
Merged
Merged
Conversation
…lls (#1533) Most sellers cannot create their own TikTok Shop Partner Center app, so a server can now register one public app through TIKTOK_SHOP_PLATFORM_APP_KEY, TIKTOK_SHOP_PLATFORM_APP_SECRET and TIKTOK_SHOP_PLATFORM_SERVICE_ID. - A TikTok Shop connector whose App key is empty signs, authorizes and renews with the server app; the app is filled in memory only and never stored on the connector. A connector with its own App key is unchanged. - The adapter's app variables are optional; on a server without the app, the setup check still reports them as missing. - The setup page hides the app fields when the server app is available, with an option to use an own app (GET /api/tiktok-shop/platform). - A callback with a code and no state (TikTok Shop App Store install) is kept as a single-use install record; POST /api/tiktok-shop/install adds or reuses a connector after the seller signs in or signs up, and exchanges the code with the server app. - Same behaviour on Cloud and self-hosted; documented in .env.example, the compose files, docs/deployment.md and docs/tool-definition.md.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Closes #1533.
Why
Most TikTok Shop sellers cannot create their own Partner Center app: TikTok gives seller-developer access only to sellers with an account manager. With this change a server can register one public TikTok Shop app and let every seller authorize it. TikTok's app review installs the app from its App Store, and that install reaches our Redirect URL without a
statewe issued. Today the callback refuses it.What changes
TIKTOK_SHOP_PLATFORM_APP_KEY,TIKTOK_SHOP_PLATFORM_APP_SECRETandTIKTOK_SHOP_PLATFORM_SERVICE_ID. All three must be set.GET /api/tiktok-shop/platformtells the dashboard whether the server app exists.needs_input), and authorize returns the existing message.app_keymatches it. It keeps the code in a single-use encrypted record that lasts 30 minutes, and it is throttled.POST /api/tiktok-shop/installreuses the workspace's waiting TikTok Shop connector, or installs the catalog adapter. It checks plan limits and the caller's role, and uses the default MCP server. It then exchanges the code..env.example,docs/deployment.md,docs/tool-definition.md. Both compose files pass the three variables through.Cloud and self-hosted
Both behave the same, and nothing depends on
isCloud(). With the variables unset, a server behaves exactly as before.Tests (worktree root and packages; all run on this branch)
node scripts/validate-adapters.mjs --warn: exit 0; the warnings are the same as on main, none for tiktok-shop.node scripts/regenerate-catalog.mjs: no change tocatalog.ts.node scripts/adapter-count.mjs --check: OK.npm run lint: 0 errors; the warnings are all in files this PR does not touch.npx tsc --noEmit -p tsconfig.json: clean.npx jest --maxWorkers=4 src/adapters src/connectors src/common/openapi.spec.ts: 805 suites passed, 3 skipped (live).npm run lint: 0 errors.npx tsc --noEmit -p tsconfig.json: clean.connector-oauth-complete.spec.ts: 6/6, including 2 new install tests.Not verified live
I could not verify two points against a real install: that App Store installs send
app_key,codeandshop_regionwith no state, and that a public app accepts theservice_idauthorization link. Both will be checked during TikTok's app review.