-
Notifications
You must be signed in to change notification settings - Fork 3.3k
feat(tiktok): add TikTok integration with Display API support #3110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: staging
Are you sure you want to change the base?
feat(tiktok): add TikTok integration with Display API support #3110
Conversation
|
@BillLeoutsakosvl346 is attempting to deploy a commit to the Sim Team on Vercel. A member of the Team first needs to authorize it. |
Greptile OverviewGreptile SummaryThis PR adds TikTok integration with OAuth authentication and Display API support, implementing 3 tools (Get User Info, List Videos, Query Videos) and a block UI with operation dropdown and conditional fields. Key changes:
Code quality:
Confidence Score: 4.5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant SimApp as Sim Application
participant Auth as Auth Provider (auth.ts)
participant TikTok as TikTok OAuth
participant TikTokAPI as TikTok Display API
participant Block as TikTok Block
participant Tool as TikTok Tool
User->>SimApp: Configure TikTok Block
SimApp->>Block: Load TikTok Block Config
Block->>User: Show OAuth credential field
User->>SimApp: Click "Connect TikTok Account"
SimApp->>Auth: Request TikTok OAuth
Auth->>TikTok: Redirect to authorization URL
Note over Auth,TikTok: Required scopes: user info,<br/>profile, stats, video list
TikTok->>User: Show authorization screen
User->>TikTok: Grant permissions
TikTok->>Auth: Send approval
Auth->>TikTok: Get credentials
TikTok->>Auth: Return credentials
Auth->>TikTokAPI: Fetch user info
TikTokAPI->>Auth: Return user profile
Auth->>SimApp: Save credential
User->>Block: Select operation & configure inputs
User->>SimApp: Execute workflow
SimApp->>Block: Get tool & params from operation
Block->>Tool: Call selected tool (get_user/list_videos/query_videos)
Tool->>TikTokAPI: API request
TikTokAPI->>Tool: Return data
Tool->>Block: Transform & return response
Block->>SimApp: Output results
SimApp->>User: Display workflow results
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6 files reviewed, 2 comments
| } | ||
| } | ||
|
|
||
| const videos: TikTokVideo[] = (data.data?.videos ?? []).map((video: any) => ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use explicit type instead of any for video parameter
| const videos: TikTokVideo[] = (data.data?.videos ?? []).map((video: any) => ({ | |
| const videos: TikTokVideo[] = (data.data?.videos ?? []).map((video: unknown) => ({ |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/sim/tools/tiktok/list_videos.ts
Line: 66:66
Comment:
use explicit type instead of `any` for video parameter
```suggestion
const videos: TikTokVideo[] = (data.data?.videos ?? []).map((video: unknown) => ({
```
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise.| } | ||
| } | ||
|
|
||
| const videos: TikTokVideo[] = (data.data?.videos ?? []).map((video: any) => ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use explicit type instead of any for video parameter
| const videos: TikTokVideo[] = (data.data?.videos ?? []).map((video: any) => ({ | |
| const videos: TikTokVideo[] = (data.data?.videos ?? []).map((video: unknown) => ({ |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/sim/tools/tiktok/query_videos.ts
Line: 63:63
Comment:
use explicit type instead of `any` for video parameter
```suggestion
const videos: TikTokVideo[] = (data.data?.videos ?? []).map((video: unknown) => ({
```
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise.
Summary
Add TikTok integration with OAuth authentication and Display API support. Implements 3 tools (Get User Info, List Videos, Query Videos) and a block UI with operation dropdown and conditional fields.
Type of Change
Testing
bun run type-check- passesbun run build(sim package) - succeedsbun run test- all 3696 tests passbun run lint- passesNote: Full API testing requires TikTok Developer approval (Display API access takes several days).
Checklist
Screenshots/Videos
Changes
New files:
tools/tiktok/- Types and 3 tool implementationsblocks/blocks/tiktok.ts- Block UI configurationModified files:
lib/oauth/types.ts- Added 'tiktok' provider typelib/oauth/oauth.ts- Added TikTok OAuth configurationlib/auth/auth.ts- Added TikTok auth providerlib/core/config/env.ts- Added TIKTOK_CLIENT_ID/SECRET env varscomponents/icons.tsx- Added TikTokIcontools/registry.ts- Registered TikTok toolsblocks/registry.ts- Registered TikTok block