How to use the balena-settings-client.get function in balena-settings-client

To help you get started, we’ve selected a few balena-settings-client examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github balena-io / balena-cli / lib / app-common.ts View on Github external
function setupBalenaSdkSharedOptions() {
	// We don't yet use balena-sdk directly everywhere, but we set up shared
	// options correctly so we can do safely in submodules
	const BalenaSdk = require('balena-sdk');
	const settings = require('balena-settings-client');
	BalenaSdk.setSharedOptions({
		apiUrl: settings.get('apiUrl'),
		imageMakerUrl: settings.get('imageMakerUrl'),
		dataDirectory: settings.get('dataDirectory'),
		retries: 2,
	});
}
github balena-io / balena-cli / lib / app-common.ts View on Github external
function setupBalenaSdkSharedOptions() {
	// We don't yet use balena-sdk directly everywhere, but we set up shared
	// options correctly so we can do safely in submodules
	const BalenaSdk = require('balena-sdk');
	const settings = require('balena-settings-client');
	BalenaSdk.setSharedOptions({
		apiUrl: settings.get('apiUrl'),
		imageMakerUrl: settings.get('imageMakerUrl'),
		dataDirectory: settings.get('dataDirectory'),
		retries: 2,
	});
}
github balena-io / balena-cli / lib / app-common.ts View on Github external
function setupGlobalHttpProxy() {
	// Doing this before requiring any other modules,
	// including the 'balena-sdk', to prevent any module from reading the http proxy config
	// before us
	const globalTunnel = require('global-tunnel-ng');
	const settings = require('balena-settings-client');
	let proxy;
	try {
		proxy = settings.get('proxy') || null;
	} catch (error1) {
		proxy = null;
	}

	// Init the tunnel even if the proxy is not configured
	// because it can also get the proxy from the http(s)_proxy env var
	// If that is not set as well the initialize will do nothing
	globalTunnel.initialize(proxy);

	// TODO: make this a feature of capitano https://github.com/balena-io/capitano/issues/48
	(global as any).PROXY_CONFIG = globalTunnel.proxyConfig;
}
github balena-io / balena-cli / lib / app-common.ts View on Github external
function setupBalenaSdkSharedOptions() {
	// We don't yet use balena-sdk directly everywhere, but we set up shared
	// options correctly so we can do safely in submodules
	const BalenaSdk = require('balena-sdk');
	const settings = require('balena-settings-client');
	BalenaSdk.setSharedOptions({
		apiUrl: settings.get('apiUrl'),
		imageMakerUrl: settings.get('imageMakerUrl'),
		dataDirectory: settings.get('dataDirectory'),
		retries: 2,
	});
}
github balena-io / balena-cli / lib / events.ts View on Github external
const getMixpanel = _.once(() => {
	const settings = require('balena-settings-client');
	return Mixpanel.init('balena-main', {
		host: `api.${settings.get('balenaUrl')}`,
		path: '/mixpanel',
		protocol: 'https',
	});
});

balena-settings-client

Balena client application shared settings

Apache-2.0
Latest version published 12 months ago

Package Health Score

58 / 100
Full package analysis

Popular balena-settings-client functions