# Extensions

### Add an extension

Adds a new chrome **manifest V3**  extension

**Method:** `client.extensions.create(params:`CreateExtensionParams`): Promise<`ExtensionResponse`>`

**Endpoint:** `POST /api/extensions/add`

**Parameters:**

* params: [CreateExtensionParams](#createextensionparams)
  * filePath: string - Path to the zip containing the manifest V3 compliant extension
  * name?: string - Optional name to give to the extension. Does not affect functionality.

**Response:** [**ExtensionResponse**](#extensionresponse)

**Example:**&#x20;

```typescript
const response = await client.extensions.create({
  filePath: "/Users/test-user/Downloads/extension.zip",
});
console.log(response);
```

### List all available extension

List all available extensions

**Method:** `client.extensions.list(``): Promise<`` ``ListExtensionsResponse >`

**Endpoint:** `POST /api/extensions/list`

**Parameters:**

* N/A

**Response:** [**ListExtensionResponse**](#listextensionsresponse)

**Example:**&#x20;

```typescript
const extensionsList = await client.extensions.list();
for (let i=0;i<extensionsList.length;i++){
    const extension = extensionsList[i]
    console.log(`extension-${i} => `, JSON.stringify(extension))
}
```

## Types

### CreateExtensionParams

```typescript
interface CreateExtensionParams {
  filePath: string;
  name?: string;
}
```

### **ExtensionResponse**

```typescript
interface ExtensionResponse {
  name: string;
  id: string;
  createdAt: string;
  updatedAt: string;
}
```

### ListExtensionsResponse

```typescript
type ListExtensionsResponse = Array<ExtensionResponse>
```





