# getProjectInfo()

## Syntax

```javascript
getProjectInfo(projectId: string, token?: string)
```

Gets project information.

## Parameters

<table><thead><tr><th width="116">Name</th><th width="121">Type</th><th width="108">Required</th><th>Description</th></tr></thead><tbody><tr><td>projectId</td><td>string</td><td>Yes</td><td>The project ID.</td></tr><tr><td>token</td><td>string</td><td>No</td><td>The authentication token response from Eueno API when login. After login, this token was saved in local storage with the name “eueno-token".</td></tr></tbody></table>

## Returns

Promise return object with the structure looks as follows:

* &#x20; totalFile: The number of files/folders in the project
* &#x20; totalSize: The project size (bytes)
* &#x20;  id: The project id
* &#x20;  name: The project name
* &#x20;  ownerAddress: The address of the account which created the project
* &#x20;  updatedAt: The last date time update project
* &#x20;  createdAt: The date-time create the project

## Example

```javascript
import {getProjectInfo} from "@eueno/lib-browser";

const getData = async () => {
   try {
     if (!token || !projectId) return;
     const response = await getBucketInfo(projectId);
     if (response?.status === 200) {
       console.log(response?.data?.data);
     } else toast.error("Error getting project information");
   } catch (error) {
     console.error(error);
   }
 };

```

Response of example:

```javascript
{
    "msg": "success",
    "data": {
        "id": 1,
        "name": "ProjectName",
        "ownerAddress": "0x…",
        "totalFile": "0",
        "totalSize": "0"
        "updatedAt": "2023-03-08T15:02:45.881Z",
        "createdAt": "2023-03-08T10:43:53.677Z"
    }
}

```
