Home > kibana-plugin-core-server > PluginConfigDescriptor
Describes a plugin configuration properties.
Signature:
export interface PluginConfigDescriptor<T = any>
// my_plugin/server/index.ts
import { schema, TypeOf } from '@kbn/config-schema';
import { PluginConfigDescriptor } from 'kibana/server';
const configSchema = schema.object({
secret: schema.string({ defaultValue: 'Only on server' }),
uiProp: schema.string({ defaultValue: 'Accessible from client' }),
});
type ConfigType = TypeOf<typeof configSchema>;
export const config: PluginConfigDescriptor<ConfigType> = {
exposeToBrowser: {
uiProp: true,
},
schema: configSchema,
deprecations: ({ rename, unused }) => [
rename('securityKey', 'secret'),
unused('deprecatedProperty'),
],
};
Property | Type | Description |
---|---|---|
deprecations | ConfigDeprecationProvider |
Provider for the ConfigDeprecation to apply to the plugin configuration. |
exposeToBrowser | { [P in keyof T]?: boolean; } |
List of configuration properties that will be available on the client-side plugin. |
schema | PluginConfigSchema<T> |
Schema to use to validate the plugin configuration.PluginConfigSchema |