faster-remote-config-sdk-js v1.9.10
Faster is a framework which provides analytics and remote-config features. This project is related to SDK for Javascript development given a easy-to-use API to work with.
Currently released features:
Analytics (Check Package):
- Track Device Installation
- Session Control
- Track & Send Events
Remote Config (This package):
- Run AB Tests
- Manage Feature Rollout
- Manage Feature Flags
1 - Getting Started
Installing
Get the package from the public npm registry, with your favorite package manager:
yarn add faster-remote-config-sdk-js
or
npm install faster-remote-config-sdk-js
Requirements
Faster Analytics
Faster Remote Config has Faster Analytics as a dependency. To install and set up Faster Analytics check the documentation.
Create Remote Configs
Remote Configs, Feature Flags and AB Tests are created on Faster Admin system. Please, contact the faster-team at Movile for more information.
Usage
Import the Faster Remote Config module and FasterConfiguration object using ES6 syntax.
import RemoteConfig, { RemoteConfigConfiguration } from 'faster-remote-config-sdk-js';
Configuring & Running
Now, configure and start Faster Remote Config SDK:
const fasterConfigurationOptions = { appVersion: '__appVersion__' };
const configuration = new RemoteConfigConfiguration('__appKey__', fasterConfigurationOptions);
RemoteConfig.configure(configuration);
const fstr = RemoteConfig.start(analyticsInstance);
2 - API Reference
FasterConfiguration.constructor(applicationKey, appVersion, options)
- applicationKey: The application key created for your application in the Faster Admin system. Use the same key used for Faster Analytics.
- options: Optional parameters to configure the Faster modules:
- appVersion: Your application version string, used for tracking.
Faster.configure(configuration):
- configuration : FasterConfiguration instance.
Faster.start(analyticsInstance):
Startup faster remote config
- analyticsInstance: Faster Analytics instance of type FasterAnalytics. Check the documentation.
Faster.get(config, custom, latitude?, longitude?):
Retrieve a remote config value.
- config: Configuration Object generated by Faster CLI.
- custom: Custom object of key and values that may be useful for a remote config.
Necessary to provide when getting a remote configs with
context
rule/segmentation. - latitude: Optional device latitude. Necessary to provide when getting a remote configs with
polygon
rule/segmentation. - longitude: Optional device longitude. Necessary to provide when getting a remote configs with
polygon
rule/segmentation.
Javascript
const value = await fasterRemoteConfig.get(fasterConfig, { plus: true }, '-22.8829362', '-47.0678489');
Typescript
type RemoteConfigSchema = {
enabled: boolean;
version: 'v0' | 'v1';
};
const value = await fasterRemoteConfig.get<RemoteConfigSchema>(
fasterNonStickyConfig,
{ plus: true },
'-22.8829362',
'-47.0678489'
);
Faster.getForced(config, custom, latitude?, longitude?):
Same as the get() but this doesn't use the cache from the SDK JS and will always get the value from the server when using this API. Only works for non-sticky remote config.
- config: Configuration Object generated by Faster CLI.
- custom: Custom object of key and values that may be useful for a remote config.
Necessary to provide when getting a remote configs with
context
rule/segmentation. - latitude: Optional device latitude. Necessary to provide when getting a remote configs with
polygon
rule/segmentation. - longitude: Optional device longitude. Necessary to provide when getting a remote configs with
polygon
rule/segmentation.
Example:
Javascript
const value = await fasterRemoteConfig.getForced(fasterNonStickyConfig, { plus: true }, '-22.8829362', '-47.0678489');
Typescript
type RemoteConfigSchema = {
enabled: boolean;
version: 'v0' | 'v1';
};
const value = await fasterRemoteConfig.getForced<RemoteConfigSchema>(
fasterNonStickyConfig,
{ plus: true },
'-22.8829362',
'-47.0678489'
);
3 - Faster CLI
Faster remote config has a fallback system to avoid let the user without any value. This system consists in create a local object in our app with the remote config default value. To generate this object you can use Faster CLI.
Install
pip3 install http://s3.amazonaws.com/faster-dropbox/faster-cli/faster-cli-py3-none-any.whl
Generate Faster Config
faster remote-config generate-defaults -p product -c configName -l javascript --path ${pwd}/example/
Please, check out the documentation or contact the faster-team at Movile for more information.
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago