1.9.10 • Published 2 years ago

faster-remote-config-sdk-js v1.9.10

Weekly downloads
166
License
UNLICENSED
Repository
github
Last release
2 years ago

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.

1.9.10

2 years ago

1.9.9

2 years ago

1.9.8

2 years ago

1.9.7

2 years ago

1.9.6

3 years ago

1.8.0

3 years ago

1.9.5

3 years ago

1.9.4

3 years ago

1.7.1

3 years ago

1.6.7

3 years ago

1.6.4

3 years ago

1.6.3

3 years ago

1.6.2

3 years ago

1.6.1

3 years ago

1.6.0

3 years ago

1.5.3

3 years ago

1.5.2

3 years ago

1.5.1

4 years ago

1.5.0

4 years ago

1.4.2

4 years ago

1.4.1

4 years ago

1.4.0

4 years ago

1.2.6

4 years ago

1.2.5

4 years ago

1.2.4

4 years ago

1.2.3

4 years ago

1.2.1

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.0.8

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago

0.0.0

5 years ago