A simple solution for managing environment variables in salesforce
A simple library which uses Custom Metadata to manage simple Key/Value Environment variables. Includes a custom UI to make configuration as easy & error free as possible.
via sfdx-clisfdx force
install --package 04t6O000001J2gsQAC -u your@org.user
via url
login and navigate to /packaging/installPackage.apexp?p0=04t6O000001J2gsQAC
. Choose Install for: Admin Only
.
This project has been updated to a namespaced unlocked package. If you installed before the namespace was added, and want to stay up-to-sync with the latest improvements, then please follow the manual migration process!
//basic usage
Map<String,String> fieldMap = (Map<String,String>) VARS.ENV.get('MY_MAP');
//with a string transform
Map<String,String> fieldMap = (String[]) VARS.ENV.get('MY_ARRAY', VARS.ENV.Transform.TO_LOWER);
// with ANY json
Foo fieldMap = (Foo) VARS.ENV.get('MY_FOO', Foo.class);
$CustomMetadata.VARS__ENV__mdt.FIELD_MAP.Val__c
Note: Only the first 255 characters will be returned in formula!
String
Integer
Decimal
Boolean
: Format: true
or false
String[]
: Format: ["a","b","c"]
Map<String,String>
: Format: {"456":"xyz","123":"abc"}
ANY
: Any valid JSON stringANY
json type!In order to enable, follow these instructions.
Quickly filter VARS based on either key or value string search.
Automatically formats JSON after editing
Add information about how it’s used, how to manage it, etc
Project Overview:
env-vars
: Salesforce metadata for core env-vars functionalityapp
: React UI for managing env-vars. Uses B.A.S.S. Stackenv-vars-encrypt
: managed package to allow for “secret” varssf-env-vars-npm
: npm package to make using env-vars easy in js applicationsPowered by Callaway Cloud Consulting