defineOptions
connector.defineOptions(fn)
Used to define the configuration options that your connector will expose in the Netlify UI.
Takes a function with an object as a parameter. The object contains the following property:
Parameter | Description |
---|---|
zod | Use to create and return a Zod object that contains your options. Supported options are outlined below. |
Learn more about configuring options for the Netlify UI.
Supported option methods
Netlify supports the following methods:
Method | Description |
---|---|
{option_type} | Define the option’s type using the related Zod method. |
meta() | Define metadata to customize the UI that will appear in the Netlify UI. |
optional() | (optional) Marks the field as optional. |
Option type
zod.{option_type}()
Define the option’s type using the related Zod method, for example zod.string()
.
Supports object()
, string()
, number()
, and boolean()
. Arrays are not supported.
meta
zod.{option_type}().meta()
Set the metadata for the option by passing an object with the following properties:
Property | Description |
---|---|
label | String representing the label to use for the form field. |
helpText | (optional) String representing the help text to display with the form field that helps users understand what value to enter. |
secret | (optional) Boolean. Set this to true to mark a field as secret and Netlify will mask the user’s value in the Netlify UI. |
optional
zod.{option_type}().optional()
Marks the field as optional when called. No parameters required.