-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Team invites doc and user journey #1644
base: main
Are you sure you want to change the base?
Conversation
The preview deployment is ready. 🟢 Open Preview | Open Build Logs Last updated at: 2025-01-28 21:59:06 CET |
{% cards_item href="/docs/products/auth/team-invites" title="Team invites" %} | ||
Manage team invites and memberships with client-side and server-side approaches. | ||
{% /cards_item %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't an authentication method, though 🧐
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stnguyen90 Should I move it out of the auth section? The task mentioned to "include it as a new journey on the Auth section." (DRL-1114)
@@ -96,6 +96,10 @@ | |||
{ | |||
label: 'Verify user', | |||
href: '/docs/products/auth/verify-user' | |||
}, | |||
{ | |||
label: 'Team invites', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From our style guide:
Prefer verbs over gerunds, for example, say "Create documents" not "Creating documents".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stnguyen90 I think we should also consider the existing convention in this file. Here's a snippet of what we have currently:
{
label: 'Anonymous login',
href: '/docs/products/auth/anonymous'
},
{
label: 'JWT login',
href: '/docs/products/auth/jwt'
},
{
label: 'SSR login',
href: '/docs/products/auth/server-side-rendering'
},
{
label: 'Custom token login',
href: '/docs/products/auth/custom-token'
},
{
label: 'Multi-factor authentication',
href: '/docs/products/auth/mfa'
},
Should I change "Team invites" to "Invite team"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stnguyen90 I've updated this to "Manage team invites". Although, we should address the inconsistency between these two routes we added this month and all the others in this file.
# Client-side email invites {% #client-side %} | ||
|
||
Client-side email invites provide a user-friendly way to add members to your team. When creating a membership, Appwrite: | ||
1. Sends an automated email invitation to the user |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also mention a user is created if one does not exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
2. Creates a pending membership | ||
3. Activates the membership when the user accepts | ||
|
||
Client-side invites are ideal when you want a simple, automated process. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The important thing to emphasize is this is used when you ant a user to be able to invite someone to have access to something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. Done
) | ||
``` | ||
{% /multicode %} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
accepting the invite should go here since it's only applicable to client-side invites.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
Appwrite provides two approaches for adding members to teams: client-side email invites and server-side custom flows. Each approach serves different use cases and offers unique benefits. | ||
|
||
# Client-side email invites {% #client-side %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remember the style guidelines on headings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stnguyen90 Should I change this to "Invite client-side"? Or "Invite client-side by email"?
) | ||
``` | ||
{% /multicode %} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be useful to have a section on permissions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stnguyen90 I've added a permissions section (Manage team permissions)
## Check membership status {% #status %} | ||
|
||
You can verify a user's membership status to determine if they've accepted an invitation: | ||
|
||
{% multicode %} | ||
```client-web | ||
import { Client, Teams } from "appwrite"; | ||
|
||
const client = new Client() | ||
.setEndpoint('https://cloud.appwrite.io/v1') | ||
.setProject('<PROJECT_ID>'); | ||
|
||
const teams = new Teams(client); | ||
|
||
const membership = await teams.getMembership( | ||
'team_id', | ||
'membership_id' | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
teams.getMembership()
requires the membership ID, which may not be available. Client-side, you'd call teams.list()
to get the teams you're part of. if you want the specific membership (say to get the role), you'd call teams.listMemberships()
and look through the memberships for the matching user.
Server-side, data isn't filtered for the user so you may need to call teams.list()
, iterate over the results and call teams.listmemberships()` and iterate over those to find the user
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stnguyen90 I've pushed an update for this. Also added client-side and server-side sections under "Check membership status"
membershipId: "membership_id" | ||
) | ||
``` | ||
```kotlin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be client-android-kotlin
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stnguyen90 Thanks, fixed
@@ -96,6 +96,10 @@ | |||
{ | |||
label: 'Verify user', | |||
href: '/docs/products/auth/verify-user' | |||
}, | |||
{ | |||
label: 'Manage team invites', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
label: 'Manage team invites', | |
label: 'Manage team invites', |
Navigation labels should focus on nouns rather than verbs to maintain a consistent style. This ensures that all items in the navigation menu have the same tone and structure, making them easier to scan and understand quickly. For example, instead of “Manage team invites,” we would simply use “Team invites.”
By avoiding verbs like “Manage,” we eliminate the need to prefix every label with an action.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On that note, we should probably also change Verify user
to User verification
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing this back. I initially used "Team invites" but just updated it from a review above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eldadfux Done
What does this PR do?
Adds team invites doc and user journey
Test plan
/docs/products/auth/team-invites
Related
DRL-1114