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

[@salesforce/b2c-tooling-sdk](../../../modules.md) / [operations/content](../index.md) / detectMetaDefinitionType

# Function: detectMetaDefinitionType()

> **detectMetaDefinitionType**(`data`, `filePath?`): `"image"` \| `"pagetype"` \| `"componenttype"` \| `"aspecttype"` \| `"cmsrecord"` \| `"customeditortype"` \| `"contentassetpageconfig"` \| `"contentassetcomponentconfig"` \| `"contentassetstructuredcontentdata"` \| `null`

Defined in: [packages/b2c-tooling-sdk/src/operations/content/validate.ts:129](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/e7c16f1ae423da0aa47b3e10be88f9770b53619b/packages/b2c-tooling-sdk/src/operations/content/validate.ts#L129)

Detect the metadefinition schema type using a 3-tier strategy:
1. File path convention (if filePath provided)
2. Property heuristics from data
3. Returns null if neither works (caller should use explicit --type or throw)

## Parameters

### data

`Record`\<`string`, `unknown`\>

### filePath?

`string`

## Returns

`"image"` \| `"pagetype"` \| `"componenttype"` \| `"aspecttype"` \| `"cmsrecord"` \| `"customeditortype"` \| `"contentassetpageconfig"` \| `"contentassetcomponentconfig"` \| `"contentassetstructuredcontentdata"` \| `null`
