# fuse-node

> OpenAPI client for fuse-node

Latest version **2.0.3** (published 2024-03-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install fuse-node
pnpm add fuse-node
yarn add fuse-node
bun add fuse-node
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.3 |
| Published | 2024-03-29 |
| First published | 2023-01-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 1.3 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | OpenAPI-Generator Contributors |
| Maintainers | boatengyeboah, adibfuse, tundealao |
| Keywords | axios, typescript, openapi-client, openapi-generator, fuse-node |

## Links

- npm: https://www.npmjs.com/package/fuse-node
- Repository: https://github.com/Cluttr-eng/fuse-node
- Homepage: https://github.com/Cluttr-eng/fuse-node#readme
- Issues: https://github.com/Cluttr-eng/fuse-node/issues
- npm.io page: https://npm.io/package/fuse-node

## Dependencies (1)

- [axios](https://npm.io/package/axios.md) ^1.6.1

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 2.0.3 (latest) — 2024-03-29
- 2.0.2 — 2023-10-17
- 2.0.1 — 2023-09-14
- 2.0.0 — 2023-08-18
- 1.0.75 — 2023-07-28
- 1.0.74 — 2023-07-19
- 1.0.72 — 2023-07-10
- 1.0.71 — 2023-06-27
- 1.0.70 — 2023-06-27
- 1.0.69 — 2023-06-23
- 1.0.68 — 2023-06-21
- 1.0.66 — 2023-06-13
- 1.0.65 — 2023-06-08
- 1.0.64 — 2023-06-05
- 1.0.63 — 2023-05-26
- … 60 more at https://npm.io/package/fuse-node/versions

## README

# fuse-node

The Fuse library provides convenient access to the Fuse REST API. It includes TypeScript definitions for all request params and response fields. It is intended to be used on the server.

## Installation
```
npm install fuse-node
```

## Quick start
Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.

BREAKING: the syncFinancialConnectionsData has changed from v2 onwards, see below for more information.

### Initialising the Fuse Api
```typescript

import {FuseApi, Configuration} from "fuse-node";

const configuration = new Configuration({
    basePath: config.FUSE_BASE_PATH,
    baseOptions: {
        headers: {
            'Fuse-Client-Id': 'my-fuse-client-id',
            'Fuse-Api-Key': 'my-fuse-api-key',
            'Content-Type': 'application/json',
            'Plaid-Client-Id': 'my-plaid-client-id',
            'Plaid-Secret': 'my-plaid-secret-id',
            'Teller-Application-Id': 'my-teller-application-id',
            'Teller-Certificate': 'my-teller-certificate',
            'Teller-Private-Key': 'my-teller-private-key',
            'Teller-Signing-Secret': 'my-teller-signing-secret',
            'Mx-Client-Id': 'my-mx-client-id',
            'Mx-Api-Key': 'my-mx-api-key',
        },
    },
});

const fuseApi = new FuseApi(configuration);
```
<br/>

### Creating a session
```typescript
const response = await fuseApi.createSession({
    supported_financial_institution_aggregators: ["plaid", "teller", "mx"],
    entity: {
        id: "12345"
    },
    products: ["account_details", "transactions"]
} as CreateSessionRequest);

const session = response.data as CreateSessionResponse;

console.log(session.client_secret)
```
<br/>

### Creating a link token
```typescript
const response = await fuseApi.createLinkToken({
    institution_id: "fuse-institution-id-from-frontend",
    session_client_secret: "session-client-secret",
    entity: {
        id: "12345"
    },
    client_name: "my-company-name"
} as CreateLinkTokenRequest);

const linkTokenData = response.data as CreateLinkTokenResponse;

console.log(linkTokenData.link_token);
```

<br/>

### Exchanging a public token
```typescript
const response = await fuseApi.exchangeFinancialConnectionsPublicToken({
    public_token: "public-token-from-frontend"
} as ExchangeFinancialConnectionsPublicTokenRequest);

const responseData = response.data as ExchangeFinancialConnectionsPublicTokenResponse;

console.log(responseData.access_token);
console.log(responseData.financial_connection_id);
```
<br/>

### Getting accounts
```typescript
const response = await fuseApi.getFinancialConnectionsAccounts({
    access_token: "my-access-token"
} as GetFinancialConnectionsAccountsRequest);

const responseData = response.data as GetFinancialConnectionsAccountsResponse;

console.log(responseData.accounts[0].name);
```
<br/>

### Sync financial connections data
V2 onwards:
```typescript
const fuseVerificationHeader = headers[
    'fuse-verification'
] as string;
const response = await fuseApi.syncFinancialConnectionsData(fuseVerificationHeader, webhookEvent);
```

V1:
```typescript
const fuseVerificationHeader = headers[
    'fuse-verification'
] as string;
const response = await fuseApi.syncFinancialConnectionsData(webhookEvent, {
    headers: {
        'fuse-verification': fuseVerificationHeader
    }
});
```
<br/>

---
_Source: https://npm.io/package/fuse-node · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
