Embeddables
We allow different components from Recrubo.app UI to be embedded in your application using iframes. This allows you to provide your users with advanced features like our Inbox, BotStudio or embedding the WhatsApp sign up process in your ATS.
Embedding Recrubo Components
Embedding Recrubo components in your application involves two main steps: Authentication
and Initialization
.
Authentication
To grant a user access to the features within Recrubo iframes, an authentication token
is required. Ensure that your application's user has a corresponding user record within Recrubo system (see Recrubo's User API for more details).
You can retrieve an authentication token for the user by sending a request to Recrubo's authentication endpoint POST public/v2/embed/authenticate
.
Example
OriginUrl
To ensure the token cannot be used to embed through different sources than intended this is stored and validated when initializing
the iframe component. This url requires the protocol
, subdomain
, root domain
and top level domain
. Some examples being https://recrubo.app
or https://demo.recrubo.app
. The url should correspond to the origin of embedding, being the client side application which will use the <iframe>
tag to embed a component
Note: The request for the authentication token should be performed from a server-side application to safeguard your API_KEY.
Initialization
Now that you have acquired an authentication token, you can initialize
any Recrubo iframe component. Initialization is carried out using the postMessage
API, which allows your application to communicate the token and settings to Recrubo's app.
postMessage
postMessage is used to send the token from your application to Recrubo, which stores the token in a http-only cookie for their domain.
The data in the message posted will always be an object, containing the action
key and optionally additional data. All Recrubo iframes accept the initialize
action it takes care of authentication using the token and configuration of the component.
Each iframe component might also have additional actions that are used to further configure or control the component. These are optional and depend on the specific component.
Reference the Embedding the Inbox guide for more details on embedding an actual component.
Receiving events
Apart from sending instructions to the embedded component, the component also sends notifications. Mainly status updates like initialized
or user actions that cannot be resolved within the component itself.
As an example, we will use the Inbox candidateOpenExternal
, this event is triggered when the user wants to open the candidate details in an external tab. Our component has no knowledge of your system's structure so in order to open the candidate details within your system we send an event instead.
This code will:
log a message once the component is fully initialized
open the candidate in a different tab (once the user triggers that action) using the externalId.
Available Embeddables
Last updated