everest-sdk
v1.0.16
Published
Everest SDK to buy crypto from fiat
Maintainers
Readme
everest-sdk
Everest JavaScript SDK — embeddable widget for card payments, crypto deposits, KYC, and exchange
Install
npm install --save everest-sdkOr include via CDN:
<script src="https://unpkg.com/everest-sdk/dist/index.js"></script>Modes
The SDK supports two modes:
| Mode | Description |
|------|-------------|
| payment | (Default) Embeds the Everest payment widget for processing card payments, accepting crypto deposits, and KYC verification. |
| exchange | Embeds the Everest exchange widget for buy/sell/swap operations. Requires appKey. |
Options
All options are passed as a single object to initialize().
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| mode | string | "payment" | Widget mode — "payment" or "exchange". |
| appKey | string | "" | Your application key (provided by Everest). Required for exchange mode. |
| env | string | "production" | Target environment. See Environments. |
| defaultCurrency | string | "ID" | Default currency code. |
| currency | string | "" | Pre-selected fiat currency for payment mode (e.g. "USD", "EUR"). |
| amount | string | "" | Pre-filled amount for payment mode. |
| service | string | "buySell" | Service type (buySell / identity). |
| widgetWidth | string | "400px" | Widget width (CSS value). |
| widgetHeight | string | "600px" | Widget height (CSS value). |
| closeButtonColor | string | "#195BB6" | Close button background color. |
| closeButtonHoverColor | string | "" | Close button hover color. Defaults to white. |
| zIndex | number | 100 | CSS z-index for the widget overlay. |
| animate | boolean | true | Enable open/close animations. |
| showLoadingSpinner | boolean | true | Show a loading spinner while the iframe loads. |
Environments
| Value | Description |
|-------|-------------|
| "production" | (Default) Live production environment. |
| "staging" | Pre-production staging environment. |
| "dev" | Internal development environment. |
Usage
Payment Mode (Default)
import everestSDK from 'everest-sdk'
// Minimal — opens the payment widget
everestSDK.initialize()
// With options
everestSDK.initialize({
mode: 'payment',
currency: 'USD',
amount: '50',
widgetWidth: '450px',
widgetHeight: '650px',
closeButtonColor: '#195BB6',
animate: true
})Exchange Mode
import everestSDK from 'everest-sdk'
everestSDK.initialize({
mode: 'exchange',
appKey: '__PROVIDED_BY_EVEREST__',
defaultCurrency: 'ID',
service: 'buySell',
widgetWidth: '600px',
widgetHeight: '700px'
})React Example
import React from 'react'
import everestSDK from 'everest-sdk'
const App = () => {
const openPayment = () => {
everestSDK.initialize({
mode: 'payment',
currency: 'USD',
amount: '100',
widgetWidth: '450px',
widgetHeight: '650px'
})
}
const openExchange = () => {
everestSDK.initialize({
mode: 'exchange',
appKey: '__PROVIDED_BY_EVEREST__',
widgetWidth: '600px',
widgetHeight: '700px'
})
}
return (
<div>
<button onClick={openPayment}>Pay Now</button>
<button onClick={openExchange}>Buy / Sell / Swap</button>
</div>
)
}
export default AppVanilla HTML
<script src="https://unpkg.com/everest-sdk/dist/index.js"></script>
<button onclick="everestSDK.initialize({ mode: 'payment', currency: 'USD', amount: '25' })">
Pay Now
</button>Behavior
- Overlay: The widget opens as a centered modal with a semi-transparent backdrop. Clicking outside the modal closes it.
- Close button: A circular close button appears at the top-right corner of the modal. It can be customized with
closeButtonColorandcloseButtonHoverColor. - Scroll lock: Page scrolling is disabled while the widget is open and restored when closed.
- Re-initialize: Calling
initialize()again removes any existing widget before creating a new one. - Loading spinner: A branded spinner displays while the iframe content loads (disable with
showLoadingSpinner: false). - Animations: Smooth fade-in/scale entrance and exit animations (disable with
animate: false). - Responsive: The widget automatically adapts to smaller screens (< 480px) with adjusted sizing and close-button placement.
License
MIT © everestdotorg
