init()

Async function that initializes Feathery

Async function that initializes the Feathery library to the correct auth and user info. This is necessary before using the rest of the API and can be called multiple times, although it will register as a no-op after the first call.

ParameterTypeDescription

SDKKey

string

Admin or user SDK key to authorize the client to communicate with Feathery servers. If it's a user SDK key, the userId will be inferred from the key.

userId

optional string

Unique ID of the user who is accessing Feathery. This can be anything as long as it's unique per user. If not specified, Feathery autogenerates the user ID.

preloadForms

optional array

Array of IDs of forms that you want to preload at initialization. This can improve form load performance. The firebase global object is accessible after pre-loading a form with Firebase activated.

userTracking

optional enum {'fingerprint', 'cookie'}

Defaults to cookie. Affects the way Feathery generates and tracks user IDs. Cookies can be cleared but fingerprints are permanent.

language

optional string

This is a comma-separated list of ISO 639-1 language code(s) to show the form in if a translation file in one of those languages has been uploaded for the form in its settings.

The languages will be prioritized according to their order in the specified string. If no translation for any of the specified languages is found, the form language will by default show up as written in the visual editor.

theme

optional string

By default forms will show with the theme connected from the Feathery dashboard, but specifying the name of a theme here will override the theme for all forms that are shown during this session. Allows you to programmatically adjust styles (e.g. dark vs light mode). Assets from the theme being overridden will either be dropped or replaced with assets with matching names and types from the new theme.

noSave

optional boolean

On the Feathery business plan, you may disable sending form data back to Feathery servers.

Last updated