Closed neekolas closed 3 weeks ago
@neekolas this is awesome!
I have some questions about "Existing member when someone clicks the link"
I think "API that lets clients check for any pending joins" will be a necessity I think it's good for keep status of invites correct, and potentially helpful for multi admin groups
@alexrisch the existing member is whoever created the invite link.
For a group with multiple admins, they will each see different links in the UI, since the invite link is tied to the creator and clicks get routed back to their phone.
I'm thinking this will be a visible notification (since you kinda want to know if someone joined the group). But could be silent too.
Makes sense, thank you for the clarification
Great work @alexrisch. Can't wait to try it out.
We are going to need group invite links for Converse. For ETHDenver, Converse put together a complicated concept where the invite links could be a developer surface. That solution required a bot to be an admin of every group, allowing the bot to read and write messages. That feels off-brand for us, especially since the app is going to be open source, and adds a bunch of complexity to the backend.
I’m proposing something more straightforward which will work on top of any group (even ones created through other apps) so long as the user has permissions to add and remove members.
To start, this is the most basic form of invite link. If you have the link you can join the group. But it offers a foundation for us to add things like token gating or other rules later. And it can become a developer surface later too, if we want.
High level flow
Existing group member creating a link
/inviteLink
API with any metadata we want to show on the landing pageinvite_link
to the client’s local DB (alongside the XMTPgroup_id
) so that it can be shown in the UI for copy/paste later and used in push notification handlersNew group member
/groups/joinFromInvite
APIExisting member when someone clicks the link
libxmtp
to load the group and add the member*To handle cases where the push notification fails to deliver (maybe you’re offline for a long time or whatever) we can also have an API that lets clients check for any pending joins. Could run that on startup.
New APIs
POST /groupInvite
Used by the creator of an invite link to make a new link.
GET /groupInvite/:id
Used to generate the landing page for a group invite link
POST /groupJoinRequest
Used by the recipient of an invite link to request to join the group.
GET /groupJoinRequest/:id
Used by the recipient of an invite link to check for the status of their request to join.
PUT /groupJoinRequest/:id
Used by the invite link creator to mark an invite as approved or rejected. For basic invite links, approval will happen immediately as soon as the push notification has been received.