# Projects

## Create Project

`client.projects.create(ProjectCreateParamsbody, RequestOptionsoptions?): Project`

**post** `/v1/projects`

Create a new project

### Parameters

- `body: ProjectCreateParams`

  - `name: string`

    Project name.

  - `tags?: Array<string>`

    Tags to attach to the Project.

### Returns

- `Project`

  Project response.

  - `id: string`

    Project ID.

  - `created_at: string`

    When the Project was created.

  - `name: string`

    Project name.

  - `resources: ProjectResources`

    Resource counts for the project.

    - `blockchain: ProjectBlockchainResources`

      Blockchain resources.

      - `rpc_nodes_dedicated: number`

        Number of dedicated RPC nodes in the project.

      - `rpc_nodes_flex: number`

        Number of flex RPC nodes in the project.

    - `cloud: ProjectCloudResources`

      Cloud infrastructure resources.

      - `connect_connections: number`

        Number of Connect connections in the project.

      - `nks_clusters: number`

        Number of NKS clusters in the project.

      - `nks_node_pools: number`

        Number of NKS node pools in the project.

      - `vms: number`

        Number of VMs in the project.

      - `volumes: number`

        Number of volumes in the project.

      - `vpcs: number`

        Number of VPCs in the project.

  - `tags: Array<string>`

    Tags attached to the Project.

  - `updated_at: string`

    When the Project was updated.

### Example

```typescript
import NirvanaLabs from '@nirvana-labs/nirvana';

const client = new NirvanaLabs({
  apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted
});

const project = await client.projects.create({ name: 'My Project' });

console.log(project.id);
```

#### Response

```json
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "created_at": "2025-01-01T00:00:00Z",
  "name": "My Project",
  "resources": {
    "blockchain": {
      "rpc_nodes_dedicated": 1,
      "rpc_nodes_flex": 3
    },
    "cloud": {
      "connect_connections": 1,
      "nks_clusters": 2,
      "nks_node_pools": 4,
      "vms": 5,
      "volumes": 10,
      "vpcs": 2
    }
  },
  "tags": [
    "production",
    "ethereum"
  ],
  "updated_at": "2025-01-01T00:00:00Z"
}
```

## Get Project Details

`client.projects.get(stringprojectID, RequestOptionsoptions?): Project`

**get** `/v1/projects/{project_id}`

Get details about a project

### Parameters

- `projectID: string`

### Returns

- `Project`

  Project response.

  - `id: string`

    Project ID.

  - `created_at: string`

    When the Project was created.

  - `name: string`

    Project name.

  - `resources: ProjectResources`

    Resource counts for the project.

    - `blockchain: ProjectBlockchainResources`

      Blockchain resources.

      - `rpc_nodes_dedicated: number`

        Number of dedicated RPC nodes in the project.

      - `rpc_nodes_flex: number`

        Number of flex RPC nodes in the project.

    - `cloud: ProjectCloudResources`

      Cloud infrastructure resources.

      - `connect_connections: number`

        Number of Connect connections in the project.

      - `nks_clusters: number`

        Number of NKS clusters in the project.

      - `nks_node_pools: number`

        Number of NKS node pools in the project.

      - `vms: number`

        Number of VMs in the project.

      - `volumes: number`

        Number of volumes in the project.

      - `vpcs: number`

        Number of VPCs in the project.

  - `tags: Array<string>`

    Tags attached to the Project.

  - `updated_at: string`

    When the Project was updated.

### Example

```typescript
import NirvanaLabs from '@nirvana-labs/nirvana';

const client = new NirvanaLabs({
  apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted
});

const project = await client.projects.get('project_id');

console.log(project.id);
```

#### Response

```json
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "created_at": "2025-01-01T00:00:00Z",
  "name": "My Project",
  "resources": {
    "blockchain": {
      "rpc_nodes_dedicated": 1,
      "rpc_nodes_flex": 3
    },
    "cloud": {
      "connect_connections": 1,
      "nks_clusters": 2,
      "nks_node_pools": 4,
      "vms": 5,
      "volumes": 10,
      "vpcs": 2
    }
  },
  "tags": [
    "production",
    "ethereum"
  ],
  "updated_at": "2025-01-01T00:00:00Z"
}
```

## Update Project

`client.projects.update(stringprojectID, ProjectUpdateParamsbody, RequestOptionsoptions?): Project`

**patch** `/v1/projects/{project_id}`

Update an existing project

### Parameters

- `projectID: string`

- `body: ProjectUpdateParams`

  - `name?: string`

    Project name.

  - `tags?: Array<string>`

    Tags to attach to the Project.

### Returns

- `Project`

  Project response.

  - `id: string`

    Project ID.

  - `created_at: string`

    When the Project was created.

  - `name: string`

    Project name.

  - `resources: ProjectResources`

    Resource counts for the project.

    - `blockchain: ProjectBlockchainResources`

      Blockchain resources.

      - `rpc_nodes_dedicated: number`

        Number of dedicated RPC nodes in the project.

      - `rpc_nodes_flex: number`

        Number of flex RPC nodes in the project.

    - `cloud: ProjectCloudResources`

      Cloud infrastructure resources.

      - `connect_connections: number`

        Number of Connect connections in the project.

      - `nks_clusters: number`

        Number of NKS clusters in the project.

      - `nks_node_pools: number`

        Number of NKS node pools in the project.

      - `vms: number`

        Number of VMs in the project.

      - `volumes: number`

        Number of volumes in the project.

      - `vpcs: number`

        Number of VPCs in the project.

  - `tags: Array<string>`

    Tags attached to the Project.

  - `updated_at: string`

    When the Project was updated.

### Example

```typescript
import NirvanaLabs from '@nirvana-labs/nirvana';

const client = new NirvanaLabs({
  apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted
});

const project = await client.projects.update('project_id');

console.log(project.id);
```

#### Response

```json
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "created_at": "2025-01-01T00:00:00Z",
  "name": "My Project",
  "resources": {
    "blockchain": {
      "rpc_nodes_dedicated": 1,
      "rpc_nodes_flex": 3
    },
    "cloud": {
      "connect_connections": 1,
      "nks_clusters": 2,
      "nks_node_pools": 4,
      "vms": 5,
      "volumes": 10,
      "vpcs": 2
    }
  },
  "tags": [
    "production",
    "ethereum"
  ],
  "updated_at": "2025-01-01T00:00:00Z"
}
```

## Delete Project

`client.projects.delete(stringprojectID, RequestOptionsoptions?): void`

**delete** `/v1/projects/{project_id}`

Delete a project

### Parameters

- `projectID: string`

### Example

```typescript
import NirvanaLabs from '@nirvana-labs/nirvana';

const client = new NirvanaLabs({
  apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted
});

await client.projects.delete('project_id');
```

## List Projects

`client.projects.list(ProjectListParamsquery?, RequestOptionsoptions?): Cursor<Project>`

**get** `/v1/projects`

List all projects

### Parameters

- `query: ProjectListParams`

  - `cursor?: string`

    Pagination cursor returned by a previous request

  - `limit?: number`

    Maximum number of items to return

### Returns

- `Project`

  Project response.

  - `id: string`

    Project ID.

  - `created_at: string`

    When the Project was created.

  - `name: string`

    Project name.

  - `resources: ProjectResources`

    Resource counts for the project.

    - `blockchain: ProjectBlockchainResources`

      Blockchain resources.

      - `rpc_nodes_dedicated: number`

        Number of dedicated RPC nodes in the project.

      - `rpc_nodes_flex: number`

        Number of flex RPC nodes in the project.

    - `cloud: ProjectCloudResources`

      Cloud infrastructure resources.

      - `connect_connections: number`

        Number of Connect connections in the project.

      - `nks_clusters: number`

        Number of NKS clusters in the project.

      - `nks_node_pools: number`

        Number of NKS node pools in the project.

      - `vms: number`

        Number of VMs in the project.

      - `volumes: number`

        Number of volumes in the project.

      - `vpcs: number`

        Number of VPCs in the project.

  - `tags: Array<string>`

    Tags attached to the Project.

  - `updated_at: string`

    When the Project was updated.

### Example

```typescript
import NirvanaLabs from '@nirvana-labs/nirvana';

const client = new NirvanaLabs({
  apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const project of client.projects.list()) {
  console.log(project.id);
}
```

#### Response

```json
{
  "items": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "created_at": "2025-01-01T00:00:00Z",
      "name": "My Project",
      "resources": {
        "blockchain": {
          "rpc_nodes_dedicated": 1,
          "rpc_nodes_flex": 3
        },
        "cloud": {
          "connect_connections": 1,
          "nks_clusters": 2,
          "nks_node_pools": 4,
          "vms": 5,
          "volumes": 10,
          "vpcs": 2
        }
      },
      "tags": [
        "production",
        "ethereum"
      ],
      "updated_at": "2025-01-01T00:00:00Z"
    }
  ],
  "pagination": {
    "next_cursor": "RhwniMT4B74siYZcPF8TnCdGI1l9rpPvg",
    "previous_cursor": "ARhwnmi1hA7wEbHbMjdYQlOB_ZusP4fYvw",
    "total_count": 125
  }
}
```

## Domain Types

### Project

- `Project`

  Project response.

  - `id: string`

    Project ID.

  - `created_at: string`

    When the Project was created.

  - `name: string`

    Project name.

  - `resources: ProjectResources`

    Resource counts for the project.

    - `blockchain: ProjectBlockchainResources`

      Blockchain resources.

      - `rpc_nodes_dedicated: number`

        Number of dedicated RPC nodes in the project.

      - `rpc_nodes_flex: number`

        Number of flex RPC nodes in the project.

    - `cloud: ProjectCloudResources`

      Cloud infrastructure resources.

      - `connect_connections: number`

        Number of Connect connections in the project.

      - `nks_clusters: number`

        Number of NKS clusters in the project.

      - `nks_node_pools: number`

        Number of NKS node pools in the project.

      - `vms: number`

        Number of VMs in the project.

      - `volumes: number`

        Number of volumes in the project.

      - `vpcs: number`

        Number of VPCs in the project.

  - `tags: Array<string>`

    Tags attached to the Project.

  - `updated_at: string`

    When the Project was updated.

### Project Blockchain Resources

- `ProjectBlockchainResources`

  Blockchain resources.

  - `rpc_nodes_dedicated: number`

    Number of dedicated RPC nodes in the project.

  - `rpc_nodes_flex: number`

    Number of flex RPC nodes in the project.

### Project Cloud Resources

- `ProjectCloudResources`

  Cloud infrastructure resources.

  - `connect_connections: number`

    Number of Connect connections in the project.

  - `nks_clusters: number`

    Number of NKS clusters in the project.

  - `nks_node_pools: number`

    Number of NKS node pools in the project.

  - `vms: number`

    Number of VMs in the project.

  - `volumes: number`

    Number of volumes in the project.

  - `vpcs: number`

    Number of VPCs in the project.

### Project List

- `ProjectList`

  - `items: Array<Project>`

    - `id: string`

      Project ID.

    - `created_at: string`

      When the Project was created.

    - `name: string`

      Project name.

    - `resources: ProjectResources`

      Resource counts for the project.

      - `blockchain: ProjectBlockchainResources`

        Blockchain resources.

        - `rpc_nodes_dedicated: number`

          Number of dedicated RPC nodes in the project.

        - `rpc_nodes_flex: number`

          Number of flex RPC nodes in the project.

      - `cloud: ProjectCloudResources`

        Cloud infrastructure resources.

        - `connect_connections: number`

          Number of Connect connections in the project.

        - `nks_clusters: number`

          Number of NKS clusters in the project.

        - `nks_node_pools: number`

          Number of NKS node pools in the project.

        - `vms: number`

          Number of VMs in the project.

        - `volumes: number`

          Number of volumes in the project.

        - `vpcs: number`

          Number of VPCs in the project.

    - `tags: Array<string>`

      Tags attached to the Project.

    - `updated_at: string`

      When the Project was updated.

  - `pagination: Pagination`

    Pagination response details.

    - `next_cursor: string | null`

    - `previous_cursor: string | null`

    - `total_count: number`

### Project Resources

- `ProjectResources`

  Resource counts for the project.

  - `blockchain: ProjectBlockchainResources`

    Blockchain resources.

    - `rpc_nodes_dedicated: number`

      Number of dedicated RPC nodes in the project.

    - `rpc_nodes_flex: number`

      Number of flex RPC nodes in the project.

  - `cloud: ProjectCloudResources`

    Cloud infrastructure resources.

    - `connect_connections: number`

      Number of Connect connections in the project.

    - `nks_clusters: number`

      Number of NKS clusters in the project.

    - `nks_node_pools: number`

      Number of NKS node pools in the project.

    - `vms: number`

      Number of VMs in the project.

    - `volumes: number`

      Number of volumes in the project.

    - `vpcs: number`

      Number of VPCs in the project.
