---
lang: en
title: 'API docs: metadata.metadatainspector.definemetadata'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
permalink: /doc/en/lb4/apidocs.metadata.metadatainspector.definemetadata.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/metadata](./metadata.md) &gt; [MetadataInspector](./metadata.metadatainspector.md) &gt; [defineMetadata](./metadata.metadatainspector.definemetadata.md)

## MetadataInspector.defineMetadata() method

Define metadata for the given target

<b>Signature:</b>

```typescript
static defineMetadata<T>(key: MetadataKey<T, DecoratorType>, value: T, target: Object, member?: string): void;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  key | <code>MetadataKey&lt;T, DecoratorType&gt;</code> | Metadata key |
|  value | <code>T</code> | Metadata value |
|  target | <code>Object</code> | Target for the metadata |
|  member | <code>string</code> | Optional property or method name |

<b>Returns:</b>

`void`


