feat(sdk): accept optional appToken on /api/sdk/v1/install#24
Merged
Conversation
Adds `appToken: z.string().optional()` to the install endpoint's request schema. Self-hosted single-tenant deployments accept the field and ignore it — no behavior change. Cloud uses it (via an onSend hook in linkforty/cloud) to scope organic install events to the right workspace, fixing the multi-tenant data leak from the post-#75 regression where organic installs couldn't be scoped to any org. Without this schema entry, Zod would strip the field from the parsed body before Cloud's hook could read it. The token itself is a public Stripe-style publishable key shipped in SDK app bundles. It only identifies which org owns the install — it cannot authenticate API actions or expose private data. Companion to LinkForty/cloud#76 (filed alongside).
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Adds an optional `appToken` field to the install endpoint's request schema. Self-hosted single-tenant deployments accept the field and ignore it - no behavior change.
Cloud uses it via an onSend hook (in linkforty/cloud, separate PR) to scope organic install events to the right workspace. Without this schema entry, Zod would strip the field before the hook could read it from `request.body`.
What this is
The `appToken` is a public Stripe-style publishable key shipped in SDK app bundles. It:
What this isn't
This PR makes no semantic change to the install endpoint's behavior in core. The endpoint:
The only change is that the Zod schema now formally accepts an extra optional field.