> For the complete documentation index, see [llms.txt](https://near-sdk-js.gitbook.io/near-sdk-js/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://near-sdk-js.gitbook.io/near-sdk-js/near-bindgen/functions/nearbindgen.md).

# NearBindgen

[**near-bindgen**](/near-sdk-js/near-bindgen.md) • **Docs**

***

[near-sdk-js v2.0.0](/near-sdk-js/packages.md) / [near-bindgen](/near-sdk-js/near-bindgen.md) / NearBindgen

## Function: NearBindgen()

> **NearBindgen**(`options`): `any`

Extends this class with the methods needed to make the contract storable/serializable and readable/deserializable to and from the blockchain. Also tells the SDK to capture and expose all view, call and initialize functions. Tells the SDK whether the contract requires initialization and whether to use a custom serialization/deserialization function when storing/reading the state.

### Parameters

• **options**

Options to configure the contract behaviour.

• **options.requireInit?**: `boolean`

Whether the contract requires initialization.

• **options.deserializer?**

Custom deserializer function to use for reading the contract state.

• **options.serializer?**

Custom serializer function to use for storing the contract state.

### Returns

`any`

### Defined in

[packages/near-sdk-js/src/near-bindgen.ts:167](https://github.com/near/near-sdk-js/blob/b58ac04fc6dff2f1120e9098c0cb059493486598/packages/near-sdk-js/src/near-bindgen.ts#L167)
