Skip to main content

Function: shareProjectWithUser()

function shareProjectWithUser(
  projectId: string,
  userId: string,
  role: "owner" | "editor" | "annotator" | "viewer",
): Promise<{
  createdAt: string;
  email: string;
  firstName: null | string;
  id: string;
  lastName: null | string;
  permissions?: object[];
  role: "owner" | "editor" | "annotator" | "viewer";
  userId: string;
}>;
Defined in: src/utils/projects.ts Shares a project with a single user.

Parameters

projectId

string ID of the project to share.

userId

string ID of the user receiving access.

role

(Optional) Role to assign to the user (defaults to viewer). "owner" | "editor" | "annotator" | "viewer"

Returns

Promise<{ createdAt: string; email: string; firstName: null | string; id: string; lastName: null | string; permissions?: object[]; role: "owner" | "editor" | "annotator" | "viewer"; userId: string; }> A promise that resolves to the created collaborator record.