Repository navigation
Conversation
A change made while a save was in flight could be marked saved without ever reaching the server. Picking Reels right after typing a caption did exactly that: the editor blur flushed the caption, the click landed before the flush's request started, 'saveStarted' overwrote the click's dirty flag, and the save's success marked everything saved. The composer kept showing Reels while the post stayed a feed post. A finished save now carries the snapshot it sent, and the composer stays dirty when anything it persists changed since that snapshot. A debounced save that fires while another is running now queues behind it instead of being skipped, since nothing re-armed the debounce once the running save landed.
…text The counter turned red whenever the active account was blocked, so an Instagram Reel without a video showed "85 / 2200" in red as if the caption were too long. Stories without media did the same. The counter now goes red only for an empty post, a section over the limit or too many sections. Any other block still marks the account's tab, and the reason is still listed where it was.
The first save of a new draft sent no per-account choices, and the store request had no rules for them, so a format picked before the draft existed was dropped. Picking Reels for an Instagram account and then typing the caption was enough: the create made a feed post, marked the composer saved, and no later save sent the format. The first save now sends each account's format, and the store request validates it with the same rule as an update.
Adds TikTok as a platform and connects it through TikTok Login Kit for web. - A Socialite driver for TikTok, which names the client id `client_key`, separates scopes with commas and reports token errors in the body. - Connecting needs every scope (user.info.basic, user.info.profile, video.publish, video.upload). A partial grant, or a connection refused because TikTok withheld the profile, revokes the token TikTok just issued and says why, unless another connected account uses the same TikTok user. - Access tokens last two hours and are refreshed when they are used, under the per-account lock, storing the rotated refresh token. Like Bluesky, TikTok stays out of the scheduled refresh sweep. - Disconnecting revokes the grant at TikTok without going through TokenManager, so a dead refresh token doesn't flag an account that is being deleted. The revoke is best effort and never blocks the delete. - TikTok has no metrics, engagement or messaging here, so the capability registries, analytics and the metrics cadence leave it out. - The platform glyph, labels, account card and seeder know TikTok, and the README and env examples cover the app setup. Publishing is added separately; until then the publish registry refuses TikTok.
Publishes through the Content Posting API: one video, or a photo post of up to 35 images, either to the profile (Direct Post) or to the creator's TikTok inbox as a draft they finish in the app. - Each TikTok target stores its own post settings in a `tiktok_options` column: post mode, privacy, comment/duet/stitch, and the commercial content disclosure. A new target starts with nothing pre-selected, as TikTok's guidelines require. - The composer requests, the public API and the MCP `update_post` tool share one validator. It allow-lists every value and rejects promotion without disclosure, private branded content, and TikTok settings on other platforms. - A creator info endpoint reads what the creator may do right now, and its calls are metered like the other TikTok calls. At publish the connector reads it again and fails the post if a stored choice is no longer allowed, instead of changing it. - Media goes over PULL_FROM_URL from the public media URL. Photos are converted to JPEG and scaled down to fit 1080x1920. Status is polled until TikTok reports the post live, in the inbox, or failed, and a post uploaded again gets its full poll budget. - The precheck holds a Direct Post until privacy and the disclosure choices are complete, and flags media TikTok can't take. - A public post stores its TikTok post id for linking to it. An inbox draft is reported as sent to the inbox rather than published. - Sync pipelines send TikTok inbox drafts, since nobody is there to pick who can view the post. A duplicated post keeps its post mode; the settings TikTok wants set by hand start unset again. - TikTok has no delete endpoint, so deleting a post only removes it here. The web, API and MCP responses say it stays live on TikTok and report a remote delete only when one was queued.
Follows TikTok's Direct Post UX guidelines when a TikTok account is a destination. - A "Post | Inbox draft" switch in the toolbar, where Instagram and Facebook pick Feed / Reels / Stories, chooses between Direct Post and a draft sent to the creator's TikTok inbox. - One card headed by the TikTok mark and "Posting as" the creator holds who can view the post (from the creator's current options, with no default), comment/duet/stitch, and the commercial content disclosure. Interactions the creator turned off in TikTok are greyed out, a duet or stitch is not offered on a photo post, and the card says when TikTok's options can't be loaded and offers a retry. - Publishing stays disabled, with the reason, while the disclosure is on but neither option is picked. The consent line links TikTok's Music Usage Confirmation, and the Branded Content Policy when it applies. - The composer's precheck matches the server's: privacy, the disclosure and the creator's longest allowed video. - Settings chosen before the draft exists are sent on the first save, and a change made while an autosave is running is saved too. - An inbox draft shows as "Sent to inbox" in the status chips and on the published view, a public post links to TikTok, and the delete and sync pipeline dialogs say what TikTok does differently. - The README lists TikTok and the limits of an unaudited app.
Like the other networks' previews, the TikTok preview draws TikTok's own chrome: the Following / For You header, the creator rail (avatar with the red follow badge, TikTok's like, comment, save and share icons, and the spinning sound disc), the bold username, a caption with bold white hashtags and mentions, and "original sound - username". The rail sits beside the caption so they never overlap. Photo posts swipe one photo at a time with TikTok's dots, and an empty draft gets a TikTok-tinted background, like the Reels and Story frames. The preview also says when a post goes to the inbox instead of the profile. Captions link TikTok hashtags and mentions to tiktok.com and leave URLs as text, since TikTok does not link them either.
TikTok refresh tokens have a fixed lifetime counted from the grant, and a refresh doesn't extend it. Access tokens are only refreshed when something is published, so an idle account, or one past that lifetime, lost its connection without warning. TikTok returns how long each refresh token has left (refresh_expires_in) and asks clients to schedule from it. That expiry is now stored on connect and on every refresh, in a new `refresh_token_expires_at` column. The token sweep refreshes a TikTok account at most once a day while its refresh token is within 14 days of running out, or while its expiry is unknown; the short-lived access tokens are still left to the just-in-time path. When the date doesn't move, the workspace is told once to reconnect before then (`reconnect_reminded_at`). A new refresh token or a reconnect clears the reminder, and a refused refresh flags the account like any other failed refresh.
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.
Summary
Adds TikTok as a connected account. It connects through Login Kit for web and publishes through the Content Posting API: one video, or a photo post of up to 35 images, either straight to the profile (Direct Post) or to the creator's TikTok inbox as a draft they finish in the app.
tiktok_optionscolumn onpost_targetsfor each target's TikTok settings, and two nullable columns onconnected_accountsfor the refresh-token reminder.Commits
The TikTok part is five commits, so it can be reviewed one at a time. tsc, Larastan and Pest pass at each of them.
client_key, scopes are comma-separated, and token errors come back in the body.user.info.basic,user.info.profile,video.publish,video.upload). A partial grant revokes the token TikTok just issued and says why. So does a connection refused because TikTok withheld the profile..env.example*.TikTokConnectorsends media withPULL_FROM_URLfrom the public media URL.tiktok_options. A new target starts with nothing pre-selected, as TikTok requires.update_posttool. It allow-lists every value, and rejects promotion without a disclosure, private branded content, and TikTok settings on other platforms.refresh_expires_in) and asks clients to schedule from it. Two new nullable columns onconnected_accounts:refresh_token_expires_atis set on connect and on every refresh.TikTokUsercarries it through Socialite, andTikTokTokenClientreturns it.reconnect_reminded_atmakes sure the workspace is told only once.accounts:refresh-tokens) refreshes a TikTok account at most once a day, while its refresh token is within 14 days of running out or its expiry is unknown. The short-lived access tokens are still left to the just-in-time refresh.AccountReconnectDueNotificationgoes to the workspace owner and to the member who connected the account. It goes out once, in-app and by email, under the same preference as "account needs attention".Setup
In the TikTok developer portal:
APP_URLhost or the object storage domain). Both videos and photos usePULL_FROM_URL, so TikTok downloads every file from there. It must be public HTTPS with no redirect.Until TikTok audits an app, Direct Post only works at Only me visibility, on private accounts, for at most five users a day. Inbox drafts don't have that limit, because the creator picks who can view the post in the TikTok app. The README covers all of this.
What isn't supported, and why
Tested against TikTok
I ran this on a sandbox app with a test deployment on 2026-11-24 and 2026-11-25:
unaudited_client_can_only_post_to_private_accounts. The app showed a clear message and didn't retry on its own.access_token_invalid, and the TikTok app's list of authorized apps dropped it.expires_in, so it works either way.Screenshots
These were taken on a local build with seeded demo accounts, and the creator info is sample data.
The connect menu is compared with upstream
mainrun locally, using the same viewport and steps. Every other screen has no before, because TikTok isn't onmain.Accounts: connect menu
main)TikTok joins the Connect account menu, and the demo TikTok account brings the count from 6 to 7.
Composer: TikTok settings (after only)
Composer: Inbox draft mode, and the For You preview (after only)
After publishing (after only)
Refresh-token reminder (after only)
Rendered with a demo TikTok account whose refresh token runs out in nine days.
Testing
Open questions
tiktok_optionsis named after the platform. Add Google Business Profile Local Posts #163 proposes a genericprovider_optionsand feat(x): tag people in photos #199 adds a feature-named column. I'm happy to rename it to whatever you prefer.