Skip to content

Use the published platform SDK in Sunny - #30

Open
ozsay wants to merge 3 commits into
mainfrom
codex/platform-sdk
Open

ozsay wants to merge 3 commits into
mainfrom
codex/platform-sdk

Conversation

@ozsay

@ozsay ozsay commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Migrate Sunny's user provisioning and non-chat app operations to @base44/sdk/platform/server, backed by the exact published preview @base44-preview/sdk@0.8.48-pr.283.2de4c8a from JavaScript SDK PR #283.

  • Use one workspace API key and immutable asUser(externalId) clients. The key needs both provisioning and token-minting permissions.
  • Persist SDK tokens through the existing Base44Link adapter without a database migration. Preserve Sunny's identity mapping, ownership checks, secret allowlist, and browser response conventions.
  • Keep SDK implementation, unit tests, examples, and API documentation in the JavaScript SDK repository. Sunny retains its adapter integration test and links to the SDK's public reference.
  • Pin the preview under the npm alias @base44/sdk, so a later stable release requires only a dependency change. Exempt only @base44-preview/sdk from the local release-age filter; keep registry/proxy routing intact.

The integration is organized as getting-started code: connection lifecycle in
base44Link.ts, explicit SDK calls and browser mapping in base44AppOperations.ts,
and persistent storage in base44TokenStore.ts. The README gives a reading order.

Testing

  • Installed the pinned dependency through the Wix embargo proxy, then verified a clean npm ci against the updated lockfile.
  • npm run platform-sdk:test — integration test passes against the installed package, covering token persistence and reuse, app projections, initial creation, preview/deploy mapping, transient mint failure, and disconnect.
  • npm run typecheck — passes.
  • npm run build — passes with placeholder auth configuration; no production credentials or live provisioning/deployment calls.
  • ESLint passes for changed code and the integration test; git diff --check passes.
  • Repository-wide lint still reports 13 existing errors and four warnings in untouched files.

Dependency review

Review the lockfile change: adds the exact SDK preview and 21 transitive packages shipped by the shared runtime/platform SDK package. No existing package versions changed. The platform server entry point does not import the runtime SDK, although the shared package installs its dependencies.

Intent (for reviewers & PR Autofix)

What this PR does

Make Sunny a consumer of the published platform server SDK for provisioning users and managing apps, retaining its application-specific persistence and authorization boundaries.

Key decisions & why

  • Optimize the starter for human readers: explicit steps, descriptive names, and a separate storage adapter keep the SDK integration easy to follow.

  • One API key; the SDK's optional storage defaults to memory, while Sunny supplies its existing persistent token adapter.

  • The published preview is pinned under the final package alias so imports remain stable when switching to a release.

  • Projected SDK results preserve Sunny's browser response conventions without exposing unrelated upstream fields.

What NOT to touch

  • Keeping chat on its existing transport with a server-only token compatibility seam is intentional; chat is outside this scope.
  • Keeping provisioning explicit and app mutations free of automatic retries is intentional to avoid implicit onboarding and duplicate mutations.
  • Keeping SDK code and its unit tests in the JavaScript SDK repository is intentional; Sunny tests its own adapters against the published package.

Tradeoffs / follow-ups

  • Replace the pinned preview alias with a stable SDK release when available.
  • Adopt the forthcoming token solution separately; browser socket grants remain out of scope.
  • Shared storage does not provide distributed token-acquisition locking.

@netlify

netlify Bot commented Sep 14, 2026

Copy link
Copy Markdown

Deploy Preview for base44-platform-starter ready!

Name Link
🔨 Latest commit 1b286e5
🔍 Latest deploy log https://app.netlify.com/projects/base44-platform-starter/deploys/6aa802b159f6720008facaf6
😎 Deploy Preview https://deploy-preview-30--base44-platform-starter.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Sep 14, 2026

Copy link
Copy Markdown

Deploy Preview for sunny44-builder ready!

Name Link
🔨 Latest commit 1b286e5
🔍 Latest deploy log https://app.netlify.com/projects/sunny44-builder/deploys/6aa802b1b19f340008598cc9
😎 Deploy Preview https://deploy-preview-30--sunny44-builder.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@ozsay ozsay changed the title Add documented platform SDK for user provisioning and app management Use the published platform SDK in Sunny Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant