@exodus/remote-config v3.0.1
@exodus/remote-config
This module provides simplified access to remote config values
Install
yarn add @exodus/remote-configUsage
This feature is designed to be used together with @exodus/headless. See using the sdk.
Play with it
- Open the playground https://exodus-hydra.pages.dev/features/remote-config
- Try out the some methods via the UI. These corresponds 1:1 with the
exodus.remoteConfigAPI. - Run
await exodus.remoteConfig.get('assets.algorand.blockExplorer')in the Dev Tools Console.
API Side
See using the sdk for more details on how features plug into the SDK and the API interface in the type declaration.
const { addressUrl, txUrl } = await exodus.remoteConfig.get('core.wallet.sunsetAssets')
const config = await exodus.remoteConfig.getAll()If you're building a feature that requires values from the remote config, you can use remote-config-atoms to subscribe to slices of the remote config. The following example demonstrates how to use remote config atoms to create an atom that subscribes to the core.exchange.preferSameNetworkUsdThreshold value:
import { createRemoteConfigAtomFactory } from '@exodus/atoms'
// below definition can be shipped with a feature and depended on by other nodes by specifying 'sameNetworkUsdThresholdAtom' as dependency
const sameNetworkUsdThresholdAtom = {
id: 'sameNetworkUsdThresholdAtom',
factory({ remoteConfig }) {
const createRemoteConfigAtom = createRemoteConfigAtomFactory({ remoteConfig })
const atom = createRemoteConfigAtom({
path: 'core.exchange.preferSameNetworkUsdThreshold',
defaultValue: 42,
})
return atom
},
dependencies: ['remoteConfig'],
}UI Side
See using the sdk for more details on basic UI-side setup.
import { selectors } from '~/ui/flux'
const MyComponent = () => {
const preferSameNetworkUsdThreshold = useSelector(
selectors.remoteConfig.get('core.exchange.preferSameNetworkUsdThreshold')
)
}5 months ago
7 months ago
8 months ago
8 months ago
8 months ago
8 months ago
9 months ago
11 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
5 years ago
5 years ago
5 years ago
5 years ago
6 years ago
7 years ago
7 years ago
7 years ago
7 years ago