mirror of
https://github.com/FlipsideCrypto/flipside-js.git
synced 2026-02-06 10:48:11 +00:00
2.7 KiB
2.7 KiB
FlipsideJS
FlipsideJS is a library of embeddable widgets that display data from the Flipside Platform API, including FCAS.
To get started, request an API Key: api@flipsidecrypto.com.
Live Examples
View Live FCAS Widget Example
View Live Table Widget Example
Install
The FlipsideJS library is made available over our CDN to ensure a speedy response time.
<script src="https://d3sek7b10w79kp.cloudfront.net/flipside-v1.5.2.js"></script>
Usage
To render an FCAS widget:
<div id="container"></div>
<script>
var flipside = new Flipside(YOUR_FLIPSIDE_API_KEY);
// To render an FCAS widget
flipside.createFCAS("container", "ZEC");
</script>
To render a Table Widget:
<div id="container"></div>
<script>
var flipside = new Flipside(YOUR_FLIPSIDE_API_KEY);
// To render an FCAS widget
flipside.createTable("container", "ZEC", {
dark: true
});
</script>
API
createFCAS(id: string, symbol: string, options: object) Creates an FCAS widget in the given DOM element ID.
Parameters
- id: ID of the DOM element in which to create the widget.
- symbol: Symbol of the asset. e.g "BTC"
- opts: Display options for the widget
Options
score: boolean: Show/hide the score section.plot: boolean: Show/hide the plot graph.logo: boolean: Show/hide the asset's logo.symbol: boolean: Show/hide the asset's symbol.trend: boolean: Show/hide the 7 day trend.rank: boolean: Show/hide the FCAS rank.dark: boolean: Renders the widget with white text.mini: boolean: Renders a smaller version of the asset's symbol and score.
Default options
flipside.createFCAS("container", "ZEC", {
score: true,
plot: true,
logo: true,
symbol: true,
trend: true,
rank: true
});
creatTable(id: string, symbol: string, options: object) Creates a Table widget in the given DOM element ID. Widget background is transparent in order to inherit the page background color.
Parameters
- id: ID of the DOM element in which to create the widget.
- symbol: Symbol of the asset. e.g "BTC"
- opts: Display options for the widget
Options
dark: boolean: Renders the widget with white text.borderColor: string: Hexcode of the border table border color. Defaults to "#737e8d".
Default options
flipside.createTable("container", "ZEC", {
dark: true,
borderColor: "#737e8d"
});
Building
$ yarn run build