Functions as a Source (October '21 Release)

Users can now write custom TypeScript functions that the Connector will invoke each time it is run to fetch data. This new feature is a powerful addition to the Connectors framework, allowing developers to build fully custom connector sources.

In addition to using Functions as a Transform in Data Connectors, you can also write a Function to serve as a data source for a Data Connector.

Similar to Transforms, the Function must have a string => string signature, meaning it will take a single string argument and return a single string. However, when using a Function as a Connector source, the strings passed into and returned by the Function should be stringified JSON objects.

For more details about creating Functions, visit our Developer Guide.

Once you have created the Functions you can select it as a Data Source for your connector. To create a Connector using a Function, you will navigate to the Knowledge Graph and click + Add Data, then select Function as your data source.

Once you do this, you will select the Function Settings from the Plugins and Functions you have created.

You must first create the TypeScript functions in the Yext CLI, and apply the resource to your account. After this, your plugins will be selectable when you configure your data source. If you are not seeing any options here, it means that there aren’t any functions that have been configured and applied to your account.

To turn on this feature in your Production account, you can fill out this form here and select “Functions as a Source” from the list of features.