A key-value store for persisting configuration options for an extension installation.
The contents will be synced in real-time to all logged-in users of the installation.
Contents will not be updated in real-time when the installation is running in
a publicly shared base.
Any key can be watched to know when the value of the key changes. If you want your
component to automatically re-render whenever any key on GlobalConfig changes, try using the
useGlobalConfig hook.
You should not need to construct this object yourself.
The maximum allowed size for a given GlobalConfig instance is 150kB.
The maximum number of keys for a given GlobalConfig instance is 1000.
A string for the top-level key, or an array of strings describing the path to set.
value
The value to set at the specified path. Use undefined to delete the value at the given path.
Checks whether the current user has permission to set the given global config key.
Accepts partial input, in the same format as setAsync.
The more information provided, the more accurate the permissions check will be.
Returns {hasPermission: true} if the current user can set the specified key,
{hasPermission: false, reasonDisplayString: string} otherwise. reasonDisplayString may
be used to display an error message to the user.
// Check if user can update a specific key and value.
Checks whether the current user has permission to perform the specified updates to global config.
Accepts partial input, in the same format as setPathsAsync.
The more information provided, the more accurate the permissions check will be.
Returns {hasPermission: true} if the current user can set the specified key,
{hasPermission: false, reasonDisplayString: string} otherwise. reasonDisplayString may be
used to display an error message to the user.
// Check if user can update a specific keys and values.
Sets multiple values. Throws if any path or value is invalid.
This action is asynchronous: await the returned promise if you wish to wait for the
updates to be persisted to Airtable servers.
Updates are applied optimistically locally, so your changes will be reflected in
GlobalConfig before the promise resolves.