Embeddable UI Components
This guide will walk you through embedding pieces of Census UI into your own application.
These features are only available for customers on the Census Embedded Scale Plan. If you don’t see these options, please reach out to Customer Support.
Census offers drop-in UI components to help you build and maintain Census resources on behalf of your customers. Enable your customers to add their connections and configure their syncs directly in your application, with almost no developer effort needed.
An embeddable component is an iframe
embedded in your application, pointing to a link that hosts a Census experience. To see a working example, check out our Embedded Demo application (source code).
This component allows end users to create and manage their Census data source connections from your application.
Initial Setup
The origin URL is the domain of the application you embed
the iframe
in. For instance, https://my-site.com
. Only approved URLs
are allowed to embed these components. Before you get started, you’ll
need to provide your Census account manager with your URL(s), or reach
out to us at support@getcensus.com.
Generate a Source Connect Link
You can create Source Connect Links from the Census UI, or via the Source Connect Link API.
Embed the Source Connect Link in an iframe
Handle events from the iframe
The iframe
emits events using the postMessage API.
You can see an example of how to handle these messages in our Demo app repo.
The following events are available to help you manage the iframe
lifecycle, via the data
property of the message:
Loaded
This event indicates the iframe
is ready to be shown to the user.
Exited
This event indicates the user has quit the connect flow. If a connection was succesfully created, the following payload will be returned:
otherwise the payload will indicate a connection was not created:
State Change
This event indicates the user is viewing a new screen in the source connection flow.
The following states are possible:
loading_screen
error_screen
start
enter_credentials
further_setup_instructions
test_connection
Was this page helpful?