Skip to content

EbitexFormProps

@ebitex/forms-sdk/react — the rendering half.

Nothing here takes an API key, deliberately: these components run in a respondent’s browser and submit to the form’s own public, anonymous endpoint. Fetch the definition server-side with createFormsClient from the root entry point and pass the result to <EbitexForm />.

optional attribution?: Attribution | (() => Attribution | undefined)

Where the respondent came from, the tags of the link they followed (the utm_* values under their short names), sent with the submission so Audience can record it as their first touch. A value, or a function asked at each submit. Defaults to the utm_source, utm_medium and utm_campaign of the page’s own address in a browser; pass your own to give a first touch you kept from an earlier page (the component stores nothing), or () => undefined to send none. The text is untrusted and is cleaned again by the server.


optional className?: string


optional consent?: ConsentOptions

Signals from your consent banner (and, by default, the browser’s Global Privacy Control and Do Not Track settings). Without any, the organization’s default applies, which is denied until an Owner changes it: the respondent is not recognised across visits. Update it as the respondent chooses; a change to cmp: 'denied' drops the token at once.


optional fetch?: (input, init?) => Promise<Response>

Injectable for tests and non-standard runtimes.

MDN Reference

RequestInfo | URL

RequestInit

Promise<Response>


optional fieldComponents?: FieldComponents

Replace the component used for one or more field types. Anything not overridden keeps its default, so this is a per-field escape hatch rather than an all-or-nothing takeover — override Input alone and your Choice fields still render normally.


form: SdkForm

A form definition from createFormsClient(...).getForm(...), fetched on your server.


optional lookup?: LookupSource

Where a Lookup field searches its options. Defaults to the form’s own public lookup endpoint, derived from submissionUrl, so an embedded form needs nothing here; pass one to route searches through your own server or to fake them in a test.


optional onError?: (error) => void

Called when a submission request fails. Validation failures are shown inline and don’t call this.

unknown

void


optional onSubmitted?: (data) => void

Called after a successful final submission.

SubmissionData

void


optional storage?: VisitorStorage

Where to keep the visitor token between visits. Optional, and the component never persists anything itself: your adapter’s set is called only when the API reports that recognising the respondent is granted, and remove whenever it is not. If you keep the token anywhere else, the same rule applies.


optional style?: CSSProperties


optional visitor?: VisitorSession

An existing session from createVisitorSession, to share one token across several forms on a page or to call forget from your own UI. When given, consent and storage here are ignored.