# @equinor/fusion-framework-react-module

> Utils for initializing and consuming fusion framework modules

Latest version **4.0.6** (published 2026-10-17) · ISC license · 0 weekly downloads

## Install

```sh
npm install @equinor/fusion-framework-react-module
pnpm add @equinor/fusion-framework-react-module
yarn add @equinor/fusion-framework-react-module
bun add @equinor/fusion-framework-react-module
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 4.0.6 |
| Published | 2026-10-17 |
| First published | 2022-08-05 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 155.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| Author | odin.rochmann@gmail.com |
| Maintainers | _odin_, nogglings, eikeland |
| Keywords | React, @equinor/fusion-framework-module |

## Links

- npm: https://www.npmjs.com/package/@equinor/fusion-framework-react-module
- Repository: https://github.com/equinor/fusion-framework
- npm.io page: https://npm.io/package/@equinor/fusion-framework-react-module

## Dependencies (1)

- [@equinor/fusion-framework-module](https://npm.io/package/@equinor/fusion-framework-module.md) ^6.1.6

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 4.0.6 (latest) — 2026-10-17
- 4.0.7-next.0 (next) — 2026-10-28
- 4.0.6-trusted-publishing-20261015-9dfe7602cd2a49a8a9df00d62c26e7304a82a85a (trusted-publishing-20261015) — 2026-10-15
- 3.1.14-msal-v5.0 (msal-v5) — 2026-01-26
- 3.1.14-cli-search-index.0 (cli-search-index) — 2025-11-14
- 3.1.13-apploader-be21a6b60eb13eee8bf869e75002d8634e9c50a9 (apploader) — 2025-05-30
- 4.0.5 — 2026-10-12
- 4.0.4 — 2026-08-31
- 4.0.3 — 2026-08-31
- 4.0.3-next.0 — 2026-08-16
- 4.0.2 — 2026-07-29
- 4.0.1 — 2026-06-03
- 4.0.0 — 2026-03-18
- 3.1.15-next.0 — 2026-03-11
- 3.1.14 — 2026-03-09
- … 80 more at https://npm.io/package/@equinor/fusion-framework-react-module/versions

## README

# React Module

## Concept

This module should provide React developers with utils for initializing and consume modules.

## Usage

__INTERNAL_MODULE__

> In general this package is implemented by framework/app scaffolding

- @equinor/fusion-framework-react-app
- @equinor/fusion-framework-react-framework

## Requirements

- React >= 17

this module requires __React 17__ or higher since the creation, configuration and initializing of modules are async. The provider must be wrapped in an `Suspense` components

## Example

### Create a provider component
```tsx
import { Suspense } from 'react';

import http, { HttpModule } from '@equinor/fusion-framework-module-http';
import msal, { MsalModule } from '@equinor/fusion-framework-module-msal';

import { createModuleProvider } from '@equinor/fusion-framework-react-module';

export const ModuleProvider = createModuleProvider((config) => {
    config.auth.configureDefault({
        tenantId: 'MY_TENANT_ID',
        clientId: 'MY_CLIENT_ID',
        redirectUri: '/authentication/login-callback',
    });
    config.http.configureClient('foo', {
        baseUri: 'https://foo.bar',
        defaultScopes: ['FOO_CLIENT_ID/.default'],
    });
  },
  [http, msal]
)
```

### Create a app component (consumer)
```tsx
import { useModule } from '@equinor/fusion-framework-react-module';

const AppComponent = () => {
  const http = useModule('http');
  const client = http.createClient('foo');
  return (
    <button onClick={client.fetchAsync('/api/todo')}>Fetch todo</button>
  );
}
```

### Render App
```tsx
import ReactDOM from 'react-dom';

import { ModuleProvider } from './Provider';
import { AppComponent } from './AppComponent';

ReactDOM.render(
  <Suspense fallback={<span>Loading framework</span>}>
    <ModuleProvider>
      <AppComponent />
    </ModuleProvider>
  </Suspense>,
  document.getElementById('root')
);
```

---
_Source: https://npm.io/package/@equinor/fusion-framework-react-module · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
