Socket
Socket
Sign inDemoInstall

@optimizely/js-sdk-datafile-manager

Package Overview
Dependencies
3
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @optimizely/js-sdk-datafile-manager

Optimizely Full Stack Datafile Manager


Version published
Weekly downloads
182K
decreased by-4.99%
Maintainers
1
Install size
167 kB
Created
Weekly downloads
 

Readme

Source

Javascript SDK Datafile Manager

This package provides datafile manager implementations for Node.js, browsers, and React Native.

Requirements

In general, an ES5-compatible environment is required, as well as Promise (must be polyfilled if absent).

Platform-specific minimum supported versions:

  • Node.js: 8
  • React Native: 0.61.5

Installation

npm i @optimizely/js-sdk-datafile-manager

For React Native, installation of peer dependency @react-native-async-storage/async-storage is also required:

npm i @react-native-async-storage/async-storage

Usage

const { HttpPollingDatafileManager } = require('@optimizely/js-sdk-datafile-manager')

const manager = new HttpPollingDatafileManager({
  sdkKey: '9LCprAQyd1bs1BBXZ3nVji',
  autoUpdate: true,
  updateInterval: 5000,
})
manager.start()
manager.onReady().then(() => {
  const datafile = manager.get()
  console.log('Manager is ready with datafile: ')
  console.log(datafile)
})
manager.on('update', ({ datafile }) => {
  console.log('New datafile available: ')
  console.log(datafile)
})

Development

  • The lint package.json script runs ESLint and Prettier. This applies formatting and lint fixes to all .ts files in the src/ directory.
  • The test package.json script runs our Jest-based test suite.
  • The tsc package.json script runs the TypeScript compiler to build the final scripts for publishing (into the lib/ directory).

FAQs

Last updated on 07 Jun 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc