Skip to main content

Using types to ensure field consistency

Reference

For more detail about field types, see the Reference page.

const fields = [
{
label: "Email",
key: "email",
type: "email",
},
{
label: "Charges",
key: "charges",
type: ["number", "usd"]
},
{
label: "Date",
key: "date",
type: [
"date",
{
locale: "en-US",
displayFormat: "EEE MMM d, y"
}
]
}
];

const settings = {
importIdentifier: "Field types example",
};

const user = {
id: "12345",
};

const dromo = new DromoUploader("FRONTEND_API_KEY", fields, settings, user);