Skip to content

Latest commit

 

History

History
50 lines (35 loc) · 1.86 KB

kibana-plugin-core-server.pluginconfigdescriptor.md

File metadata and controls

50 lines (35 loc) · 1.86 KB

Home > kibana-plugin-core-server > PluginConfigDescriptor

PluginConfigDescriptor interface

Describes a plugin configuration properties.

Signature:

export interface PluginConfigDescriptor<T = any> 

Example

// 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'),
  ],
};

Properties

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