Skip to content
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

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open

Conversation

ebenezerdon
Copy link
Contributor

What does this PR do?

Adds team invites doc and user journey

Test plan

  • Run the app and navigate to /docs/products/auth/team-invites
  • Verify content and that team invites is added as a new auth journey

Related

DRL-1114

@coolify-appwrite-org
Copy link

coolify-appwrite-org bot commented Jan 14, 2025

The preview deployment is ready. 🟢

Open Preview | Open Build Logs

Last updated at: 2025-01-28 21:59:06 CET

Comment on lines +49 to +51
{% 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 %}
Copy link
Contributor

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 🧐

Copy link
Contributor Author

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',
Copy link
Contributor

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".

Copy link
Contributor Author

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"?

Copy link
Contributor Author

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.

Screenshot 2025-01-27 at 21 14 57

# 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
Copy link
Contributor

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.

Copy link
Contributor Author

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.
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. Done

)
```
{% /multicode %}

Copy link
Contributor

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.

Copy link
Contributor Author

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 %}
Copy link
Contributor

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.

Copy link
Contributor Author

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 %}

Copy link
Contributor

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.

Copy link
Contributor Author

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)

Comment on lines 253 to 270
## 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'
);
Copy link
Contributor

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

Copy link
Contributor Author

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
Copy link
Contributor

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?

Copy link
Contributor Author

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',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Copy link
Member

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

Copy link
Contributor Author

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eldadfux Done

@ebenezerdon ebenezerdon requested a review from eldadfux January 28, 2025 21:43
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.

3 participants