Open
Conversation
Add CG plugin lib integration so Gardens can run as an iframe plugin inside app.cg. Includes client-side plugin initialization, CG data context (user/community info), server-side signing endpoint, and a greeting banner on the gardens page. Gracefully no-ops when running standalone (no iframeUid). Co-Authored-By: Claude Opus 4.6 <[email protected]>
When running as a CG plugin, the create community form now auto-populates the community name field with the CG community title. Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
@flotob is attempting to deploy a commit to the 1hive Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
|
Hey @flotob thanks for setuping that up. I just have some interogations, |
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.
Common Ground Plugin Integration
Summary
This PR adds support for running the Gardens app as a Common Ground plugin inside an iframe. When loaded through CG, the app can access the CG runtime API to retrieve user and community data.
What's implemented
@common-ground-dao/cg-plugin-lib(client) and@common-ground-dao/cg-plugin-lib-host(server) packagesapp/api/sign/route.ts): Next.js API route that signs requests with the plugin private key, required by the CG client lib to authenticate with the CG runtimeCgPluginLibProviderinitializes the CG client lib when?iframeUid=is present in the URL;CgDataProviderfetches and caches user/community info from CG. Both gracefully no-op when the app runs standalone (outside the iframe)What's missing / next steps
1. Community-scoped view instead of global list
Currently, when Gardens loads inside a CG community, it still shows the global list of all Gardens communities across all chains. Instead, it should detect whether the current CG community already has a linked Gardens community and navigate directly to it.
2. CG community <-> Gardens community mapping
To make the above work, we need a reliable way to match a CG community to its corresponding Gardens community. Name matching is too fragile. Two options:
cgCommunityIdfield to theRegistryCommunitycontract (or its metadata) so we can look up a Gardens community by CG community ID. This is the most reliable approach but requires a contract change.The CG community ID is available via
communityInfo.idfrom the plugin API.3. Conditional UX based on community state and user role
Once the mapping exists, the plugin should handle two cases when a CG community loads Gardens:
isAdminfromuseCgData()): show the create community form with all available fields pre-filled from CG data (name, and potentially token address or other fields the CG API provides)