0.0.3 • Published 4 years ago
fm-bridge v0.0.3
ForceManager Bridge
Communication service for ForceManager Fragments.
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.
<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.
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.
<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>
0.0.3
4 years ago
0.0.1
4 years ago
0.0.2
4 years ago
0.0.1-beta.23
4 years ago
0.0.1-beta.22
4 years ago
0.0.1-beta.20
4 years ago
0.0.1-beta.19
4 years ago
0.0.1-beta.18
4 years ago
0.0.1-beta.17
4 years ago
0.0.1-beta.16
4 years ago
0.0.1-beta.15
4 years ago
0.0.1-beta.14.1
4 years ago
0.0.1-beta.14
4 years ago
0.0.1-beta.13
5 years ago
0.0.1-beta.12
5 years ago
0.0.1-beta.11
5 years ago
0.0.1-beta.10
5 years ago
0.0.1-beta.9
5 years ago
0.0.1-beta.8
5 years ago
0.0.1-beta.7
5 years ago
0.0.1-beta.6
5 years ago
0.0.1-beta.5
5 years ago
0.0.1-beta.4
5 years ago
0.0.1-beta.3
5 years ago
0.0.1-beta.1
5 years ago
0.0.1-alpha.10
5 years ago
0.0.1-alpha.9
5 years ago
0.0.1-alpha.7
5 years ago
0.0.1-alpha.6
5 years ago
0.0.1-beta.2
5 years ago
0.0.1-alpha.5
5 years ago
0.0.1-alpha.4
5 years ago
0.0.1-alpha.3
5 years ago
0.0.1-alpha.2
5 years ago
0.0.1-alpha.1
5 years ago