JSPM

@jigrawesome/jigra-managed-configurations

6.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q15348F
  • License MIT

Jigra plugin to access managed configuration settings.

Package Exports

  • @jigrawesome/jigra-managed-configurations
  • @jigrawesome/jigra-managed-configurations/dist/esm/index.js
  • @jigrawesome/jigra-managed-configurations/dist/plugin.cjs.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@jigrawesome/jigra-managed-configurations) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@jigrawesome/jigra-managed-configurations

Jigra plugin to access managed configuration settings.

Installation

npm install @jigrawesome/jigra-managed-configurations
npx jig sync

Android

See Define managed configurations and follow the instructions to declare the app's managed configurations correctly.

Configuration

No configuration required for this plugin.

Usage

import { ManagedConfigurations } from '@jigrawesome/jigra-managed-configurations';

const getString = async () => {
  const result = await ManagedConfigurations.getString({ key: 'server_url' });
  return result.value;
};

const getNumber = async () => {
  const result = await ManagedConfigurations.getNumber({ key: 'server_port' });
  return result.value;
};

const getBoolean = async () => {
  const result = await ManagedConfigurations.getBoolean({
    key: 'download_on_cellular',
  });
  return result.value;
};

API

getString(...)

getString(options: GetOptions) => Promise<GetResult<string>>

Fetches the value associated with the given key, or null if no mapping exists for the given key.

Only available on Android and iOS.

Param Type
options GetOptions

Returns: Promise<GetResult<string>>


getNumber(...)

getNumber(options: GetOptions) => Promise<GetResult<number>>

Fetches the value associated with the given key, or null if no mapping exists for the given key.

Only available on Android and iOS.

Param Type
options GetOptions

Returns: Promise<GetResult<number>>


getBoolean(...)

getBoolean(options: GetOptions) => Promise<GetResult<boolean>>

Fetches the value associated with the given key, or null if no mapping exists for the given key.

Only available on Android and iOS.

Param Type
options GetOptions

Returns: Promise<GetResult<boolean>>


Interfaces

GetResult

Prop Type Description
value T | null The value of the configuration entry, or null if no mapping exists for the given key.

GetOptions

Prop Type Description
key string Unique key for the configuration entry.

Test your implementation

On Android, see Set up device owner for testing and follow the instructions to set up a device owner testing environment.

On iOS, you need to install the app as a managed app with a MDM solution.

Changelog

See CHANGELOG.md.

License

See LICENSE.