shareProject()
shareProject(
projectId:string,request:ShareProjectRequest):Promise<ShareProjectResponse>
Defined in: packages/core/src/index.ts:2077
Share a project with other users
Parameters
| Parameter | Type | Description |
|---|---|---|
projectId | string | The unique identifier of the project to share |
request | ShareProjectRequest | Share request with user IDs and permissions |
Returns
Promise<ShareProjectResponse>
Share response with status for each user
Throws
401 - Not authenticated
Throws
404 - Project or user not found
Example
import { shareProject } from "@cpod/sdk";
const result = await shareProject("project-123", {
user_ids: ["user-456", "user-789"],
permission: "editor", // "viewer" or "editor"
});
console.log(`Shared with ${result.shared_count} users`);