# Manifold Ethereum Provider

{% hint style="info" %}
This section is for advanced users only.  If you are just working on frontend integration, you can skip right to the [Connect Widget documentation](/manifold-for-developers/resources/widgets/connect-widget.md).
{% endhint %}

## Overview

The Manifold Ethereum Provider is a wrapper around [ethers.js](https://docs.ethers.io/v5/) that provides a number of convenience APIs for chain detection, wallet detection and automated provider switching (it will use the injected browser provider whenever possible). &#x20;

The Manifold Ethereum Provider is instantiated by the [Connect Widget](/manifold-for-developers/resources/widgets/connect-widget.md)

### Making Use of the Manifold Ethereum Provider

#### Step 1: Creation

Add the [Connect Widget](/manifold-for-developers/resources/widgets/connect-widget.md) to your page.  This will instantiate the Manifold Ethereum Provider.

#### Step 2: Initialization

Wait for Manifold Ethereum Provider to finish initialization.  You can do this by using the `detectManifoldEthereumProvider` function found in the [`@manifoldxyz/frontend-provider-utils`](https://www.npmjs.com/package/@manifoldxyz/frontend-provider-utils) npm package

{% embed url="<https://www.npmjs.com/package/@manifoldxyz/frontend-provider-utils>" %}
Utility which allows you to detect when the Manifold Ethereum Provider is instantiated by the Connect Widget
{% endembed %}

Once initialized, you will have access to the Manifold Ethereum Provider via `window.ManifoldEthereumProvider`

#### Step 3: Usage

You can find all the functionality that Manifold Ethereum Provider gives you by looking at the [`@manifoldxyz/frontend-provider-types`](https://www.npmjs.com/package/@manifoldxyz/frontend-provider-types) package.

{% embed url="<https://www.npmjs.com/package/@manifoldxyz/frontend-provider-types>" %}
Type definitions for accessing the Manifold Ethereum Provider
{% endembed %}

```typescript
import { EthereumProvider } from @manifoldxyz/frontend-provider-types

declare global {
  interface Window {
    ManifoldEthereumProvider: typeof EthereumProvider;
  }
}

// Access the ManifoldEthereumProvider via window.ManifoldEthereumProvider

```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.manifold.xyz/manifold-for-developers/resources/manifold-ethereum-provider.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
