---
editLink: false
lastUpdated: false
---

[@salesforce/b2c-tooling-sdk](../../../modules.md) / [operations/object-types](../index.md) / generateCustomAttributeTypes

# Function: generateCustomAttributeTypes()

> **generateCustomAttributeTypes**(`client`, `options`): `Promise`\<[`CustomAttributeTypesResult`](../interfaces/CustomAttributeTypesResult.md)\>

Defined in: [packages/b2c-tooling-sdk/src/operations/object-types/script-types.ts:231](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/d7ff38c7ca2b1411cd718b9554500c9416f00266/packages/b2c-tooling-sdk/src/operations/object-types/script-types.ts#L231)

Reads custom attribute definitions from an instance and builds the
declaration file from [buildCustomAttributeTypes](buildCustomAttributeTypes.md).

## Parameters

### client

[`ObjectTypesClient`](../classes/ObjectTypesClient.md)

### options

[`GenerateCustomAttributeTypesOptions`](../interfaces/GenerateCustomAttributeTypesOptions.md) = `{}`

## Returns

`Promise`\<[`CustomAttributeTypesResult`](../interfaces/CustomAttributeTypesResult.md)\>

## Example

```ts
const {content} = await generateCustomAttributeTypes(new ObjectTypesClient(config), {objectTypes: ['Product']});
await fs.writeFile('custom-attributes.d.ts', content);
```
