Skip to content

Use new sdk in hello-world#16302

Merged
martmull merged 1 commit intomainfrom
use-twenty-sdk-in-hello-world
Dec 4, 2025
Merged

Use new sdk in hello-world#16302
martmull merged 1 commit intomainfrom
use-twenty-sdk-in-hello-world

Conversation

@martmull
Copy link
Copy Markdown
Contributor

@martmull martmull commented Dec 3, 2025

as title

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Dec 3, 2025

Greptile Overview

Greptile Summary

This PR migrates the hello-world app from twenty-sdk 0.0.6 to 0.1.2, updating imports to use the new SDK barrel exports pattern and adding npm scripts for easier development workflow.

Key changes:

  • Updated all imports from twenty-sdk/application to twenty-sdk (now using barrel exports)
  • Renamed ServerlessFunctionConfig type to FunctionConfig
  • Added development scripts (dev, generate, sync, uninstall, auth) to package.json
  • Upgraded SDK version from 0.0.6 to 0.1.2 with corresponding yarn.lock updates

The migration is straightforward and follows the new SDK structure. The code references a generated directory (via import { createClient } from '../../generated') which is created by the SDK's code generation process during development or sync.

Confidence Score: 5/5

  • This PR is safe to merge with no identified issues
  • The changes are a straightforward SDK version upgrade with clean import path updates and type renames. All imports are correctly aligned with the new SDK structure (verified by checking /packages/twenty-sdk/src/application/index.ts). The addition of npm scripts enhances developer experience without affecting runtime behavior.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
packages/twenty-apps/hello-world/application.config.ts 5/5 Updated import from twenty-sdk/application to twenty-sdk to use new SDK barrel export
packages/twenty-apps/hello-world/package.json 5/5 Upgraded twenty-sdk from 0.0.6 to 0.1.2, added npm scripts for development and app management
packages/twenty-apps/hello-world/src/actions/create-new-post-card.ts 5/5 Changed type from ServerlessFunctionConfig to FunctionConfig with new SDK import path
packages/twenty-apps/hello-world/src/objects/postCard.ts 5/5 Updated imports from twenty-sdk/application to twenty-sdk to use new SDK barrel export

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant App as Hello World App
    participant SDK as Twenty SDK 0.1.2
    participant API as Twenty API

    Note over Dev,SDK: SDK Migration Flow
    
    Dev->>App: Import types from 'twenty-sdk'
    App->>SDK: ApplicationConfig (from barrel export)
    App->>SDK: FunctionConfig (renamed from ServerlessFunctionConfig)
    App->>SDK: Field decorators & types
    
    Note over Dev,API: Runtime Execution Flow
    
    Dev->>App: Trigger create-new-post-card function
    App->>SDK: Use createClient() from generated code
    SDK->>API: GraphQL mutation with API key
    API-->>SDK: Return created PostCard
    SDK-->>App: Return result
    App-->>Dev: Success response
Loading

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@martmull martmull merged commit 3a14fe8 into main Dec 4, 2025
52 checks passed
@martmull martmull deleted the use-twenty-sdk-in-hello-world branch December 4, 2025 08:17
@twenty-eng-sync
Copy link
Copy Markdown

Hey @martmull! After you've done the QA of your Pull Request, you can mark it as done here. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants