> ## Documentation Index
> Fetch the complete documentation index at: https://docs.galileo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Projects

***

# Class: Projects

Defined in: [src/utils/projects.ts](https://github.com/rungalileo/galileo-js/blob/main/src/utils/projects.ts)

Projects class for managing projects in the Galileo platform.
Delegates to the internal GalileoApiClient for API interactions.

## Constructors

### Constructor

```ts theme={null}
new Projects(): Projects;
```

#### Returns

`Projects`

## Methods

### addUserCollaborators()

```ts theme={null}
addUserCollaborators(collaborators: object[], projectId?: string): Promise<object[]>;
```

Defined in: [src/utils/projects.ts](https://github.com/rungalileo/galileo-js/blob/main/src/utils/projects.ts)

Adds user collaborators to a project.

#### Parameters

##### collaborators

`object`\[]

Collaborator payloads to create.

##### projectId?

`string`

(Optional) Project ID override when client is not project-scoped.

#### Returns

`Promise`\<`object`\[]>

A promise that resolves to the created collaborators.

***

### create()

```ts theme={null}
create(name: string, options?: ProjectCreateOptions): Promise<{
  createdAt: string;
  createdBy?: null | string;
  id: string;
  name?: null | string;
  type?:   | null
     | "prompt_evaluation"
     | "llm_monitor"
     | "gen_ai"
     | "training_inference"
     | "protect";
  updatedAt: string;
}>;
```

Defined in: [src/utils/projects.ts](https://github.com/rungalileo/galileo-js/blob/main/src/utils/projects.ts)

Creates a new project.

#### Parameters

##### name

`string`

Name of the project.

##### options?

[`ProjectCreateOptions`](/sdk-api/typescript/reference/types/type-aliases/ProjectCreateOptions)

(Optional) Additional project creation settings.

#### Returns

`Promise`\<\{
`createdAt`: `string`;
`createdBy?`: `null` | `string`;
`id`: `string`;
`name?`: `null` | `string`;
`type?`: | `null`
\| `"prompt_evaluation"`
\| `"llm_monitor"`
\| `"gen_ai"`
\| `"training_inference"`
\| `"protect"`;
`updatedAt`: `string`;
}>

A promise that resolves to the created project.

***

### delete()

```ts theme={null}
delete(options: GetProjectOptions): Promise<{
  message: string;
}>;
```

Defined in: [src/utils/projects.ts](https://github.com/rungalileo/galileo-js/blob/main/src/utils/projects.ts)

Deletes a project by ID or name without falling back to defaults.

#### Parameters

##### options

[`GetProjectOptions`](/sdk-api/typescript/reference/types/type-aliases/GetProjectOptions)

The deletion options.

#### Returns

`Promise`\<\{
`message`: `string`;
}>

A promise that resolves to the delete response payload.

***

### get()

```ts theme={null}
get(options: GetProjectOptions): Promise<{
  bookmark?: boolean;
  createdAt: string;
  createdBy: string;
  createdByUser: {
     email: string;
     firstName?: null | string;
     id: string;
     lastName?: null | string;
  };
  description?: null | string;
  id: string;
  labels?: "sample"[];
  name?: null | string;
  permissions?: object[];
  runs: object[];
  type?:   | null
     | "prompt_evaluation"
     | "llm_monitor"
     | "gen_ai"
     | "training_inference"
     | "protect";
  updatedAt: string;
}>;
```

Defined in: [src/utils/projects.ts](https://github.com/rungalileo/galileo-js/blob/main/src/utils/projects.ts)

Gets a project by ID or name.

#### Parameters

##### options

[`GetProjectOptions`](/sdk-api/typescript/reference/types/type-aliases/GetProjectOptions)

The lookup options.

#### Returns

`Promise`\<\{
`bookmark?`: `boolean`;
`createdAt`: `string`;
`createdBy`: `string`;
`createdByUser`: \{
`email`: `string`;
`firstName?`: `null` | `string`;
`id`: `string`;
`lastName?`: `null` | `string`;
};
`description?`: `null` | `string`;
`id`: `string`;
`labels?`: `"sample"`\[];
`name?`: `null` | `string`;
`permissions?`: `object`\[];
`runs`: `object`\[];
`type?`: | `null`
\| `"prompt_evaluation"`
\| `"llm_monitor"`
\| `"gen_ai"`
\| `"training_inference"`
\| `"protect"`;
`updatedAt`: `string`;
}>

A promise that resolves to the matching project.

***

### getAllUserCollaborators()

```ts theme={null}
getAllUserCollaborators(projectId?: string): Promise<object[]>;
```

Defined in: [src/utils/projects.ts](https://github.com/rungalileo/galileo-js/blob/main/src/utils/projects.ts)

Lists every user collaborator for a project, exhausting pagination tokens.

#### Parameters

##### projectId?

`string`

(Optional) The project ID to list collaborators for.

#### Returns

`Promise`\<`object`\[]>

A promise that resolves to all collaborators for the project.

***

### getWithEnvFallbacks()

```ts theme={null}
getWithEnvFallbacks(options: GetProjectOptions): Promise<{
  bookmark?: boolean;
  createdAt: string;
  createdBy: string;
  createdByUser: {
     email: string;
     firstName?: null | string;
     id: string;
     lastName?: null | string;
  };
  description?: null | string;
  id: string;
  labels?: "sample"[];
  name?: null | string;
  permissions?: object[];
  runs: object[];
  type?:   | null
     | "prompt_evaluation"
     | "llm_monitor"
     | "gen_ai"
     | "training_inference"
     | "protect";
  updatedAt: string;
}>;
```

Defined in: [src/utils/projects.ts](https://github.com/rungalileo/galileo-js/blob/main/src/utils/projects.ts)

Gets a project by ID or name, falling back to environment configuration when omitted.

#### Parameters

##### options

[`GetProjectOptions`](/sdk-api/typescript/reference/types/type-aliases/GetProjectOptions)

The lookup options.

#### Returns

`Promise`\<\{
`bookmark?`: `boolean`;
`createdAt`: `string`;
`createdBy`: `string`;
`createdByUser`: \{
`email`: `string`;
`firstName?`: `null` | `string`;
`id`: `string`;
`lastName?`: `null` | `string`;
};
`description?`: `null` | `string`;
`id`: `string`;
`labels?`: `"sample"`\[];
`name?`: `null` | `string`;
`permissions?`: `object`\[];
`runs`: `object`\[];
`type?`: | `null`
\| `"prompt_evaluation"`
\| `"llm_monitor"`
\| `"gen_ai"`
\| `"training_inference"`
\| `"protect"`;
`updatedAt`: `string`;
}>

A promise that resolves to the matching project.

***

### list()

```ts theme={null}
list(projectType?:
  | "prompt_evaluation"
  | "llm_monitor"
  | "gen_ai"
  | "training_inference"
| "protect"): Promise<object[]>;
```

Defined in: [src/utils/projects.ts](https://github.com/rungalileo/galileo-js/blob/main/src/utils/projects.ts)

Lists projects available to the authenticated user.

#### Parameters

##### projectType?

(Optional) Project type filter to apply.

`"prompt_evaluation"` | `"llm_monitor"` | `"gen_ai"` | `"training_inference"` | `"protect"`

#### Returns

`Promise`\<`object`\[]>

A promise that resolves to the matching projects.

***

### removeUserCollaborator()

```ts theme={null}
removeUserCollaborator(userId: string, projectId: string): Promise<void>;
```

Defined in: [src/utils/projects.ts](https://github.com/rungalileo/galileo-js/blob/main/src/utils/projects.ts)

Removes a user collaborator from a project.

#### Parameters

##### userId

`string`

ID of the collaborator to remove.

##### projectId

`string`

Project ID that the collaborator belongs to.

#### Returns

`Promise`\<`void`>

A promise that resolves when removal succeeds.

***

### shareWithUser()

```ts theme={null}
shareWithUser(
   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](https://github.com/rungalileo/galileo-js/blob/main/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.

***

### unshareWithUser()

```ts theme={null}
unshareWithUser(projectId: string, userId: string): Promise<void>;
```

Defined in: [src/utils/projects.ts](https://github.com/rungalileo/galileo-js/blob/main/src/utils/projects.ts)

Removes a user's access to a project.

#### Parameters

##### projectId

`string`

ID of the project to unshare.

##### userId

`string`

ID of the user losing access.

#### Returns

`Promise`\<`void`>

A promise that resolves when the user is unshared.

***

### updateUserCollaborator()

```ts theme={null}
updateUserCollaborator(
   userId: string,
   update: object,
   projectId?: string): 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](https://github.com/rungalileo/galileo-js/blob/main/src/utils/projects.ts)

Updates a user collaborator assignment.

#### Parameters

##### userId

`string`

ID of the collaborator to update.

##### update

Update payload describing the collaborator changes.

###### role

`"owner"` | `"editor"` | `"annotator"` | `"viewer"`

(Optional) Updated role for the collaborator.

##### projectId?

`string`

(Optional) Project ID override when client is not project-scoped.

#### 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 updated collaborator.
