# fm-bridge

> ForceManager Bridge

Latest version **0.0.3** (published 2020-10-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install fm-bridge
pnpm add fm-bridge
yarn add fm-bridge
bun add fm-bridge
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2020-10-15 |
| First published | 2019-02-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 327.4 KB |
| Known vulnerabilities | 0 (+25 in 1 direct dependencies) |
| Install scripts | no |
| Author | SPT |
| Maintainers | sergipt |
| Keywords | webpack, es6, starter, library, universal, umd, commonjs |

## Links

- npm: https://www.npmjs.com/package/fm-bridge
- Repository: https://github.com/ForceManager/fm-bridge
- Issues: https://github.com/ForceManager/fm-bridge/issues
- npm.io page: https://npm.io/package/fm-bridge

## Dependencies (3)

- [axios](https://npm.io/package/axios.md) ^0.19.2
- [moment](https://npm.io/package/moment.md) ^2.24.0
- [post-robot](https://npm.io/package/post-robot.md) ^9.0.1

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 0.0.3 (latest) — 2020-10-15
- 0.0.2 — 2020-10-13
- 0.0.1 — 2020-10-13
- 0.0.1-beta.23 — 2020-05-20
- 0.0.1-beta.22 — 2020-05-20
- 0.0.1-beta.20 — 2020-04-30
- 0.0.1-beta.19 — 2020-04-30
- 0.0.1-beta.18 — 2020-04-27
- 0.0.1-beta.17 — 2020-04-27
- 0.0.1-beta.16 — 2020-02-18
- 0.0.1-beta.15 — 2020-02-07
- 0.0.1-beta.14.1 — 2020-01-16
- 0.0.1-beta.14 — 2019-12-04
- 0.0.1-beta.13 — 2019-11-12
- 0.0.1-beta.12 — 2019-10-23
- … 20 more at https://npm.io/package/fm-bridge/versions

## README

# ForceManager Bridge

Communication service for ForceManager Fragments.

![Travis](https://travis-ci.org/krasimir/webpack-library-starter.svg?branch=master)

## Installation

ForceManager Bridge is available as an npm & yarn package.

### As a dependency.

With yarn (recommended):

```
yarn add fm-bridge
```

With npm:

```
npm install fm-bridge
```

### As a script.

```html
<script
  type="text/javascript"
  src="https://d15abo3q1yyhdy.cloudfront.net/fragments/fm-bridge.min.js"
></script>
;
```

## ⭐️ Features

- Axios instance configured to make calls to ForceManager API.
- Function getContext to get the context (user, account, etc.).

## Usage

In the following example we can see how to get the ID of the current account using the bridge and make an API call to get the details of this account usings the axios instance.

### Example importing the package as a dependency.

```js
import { bridge, axios } from 'fm-bridge';

bridge
  .getContext()
  .then(({ data }) => axios.get(`/accounts/${data.entity.id.toString()}`))
  .then(({ data }) => {
    console.log('Account details:', data);
  })
  .catch((err) => {
    console.warn(err);
  });
```

### Example importing the package as script.

```html
<script
  type="text/javascript"
  src="https://d15abo3q1yyhdy.cloudfront.net/fragments/fm-bridge.min.js"
></script>
;

<script>
  fmBridge.bridge.getContext()
   .then(function(res) {
     return fmBridge.axios.get(`/accounts/${res.data.entity.id.toString()}`)
   })
   .then(function((res)) {
     console.log('Account details:', res.data);
   })
   .catch(function(err) {
     console.warn(err);
   });
</script>
```

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