# deleteProject()

## Syntax

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

Delete the project by project ID.

## 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 returns an object with two properties is:

* “folders” - \[ ]: array of folders name
* “files” - \[ ]: array of objects, each object includes file information

## Example

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

const onDelete = async () => {
   if (!token || !projectId) return;
   try {
     const res = await deleteProject(projectId);
     if (res?.status === 200) {
       console.log("Delete successfully");
     }
   } catch (error) {
     console.error(error);
   }
};

```

Response of example:

```javascript
{
    "msg": "success"
}
```
