Rownd Hub Docs

The Main Snippet

The Basics

It all starts with a snippet.
Add this snippet to the footer of your website (right before the </body> tag).
Webflow, Wordpress, Cloudflare (any site), Netlify (JAMSTACK)

!function(){var e=window._rphConfig=window._rphConfig||[];let t=window.localStorage.getItem("rph_base_url_override")||"https://hub.rownd.io";e.push(["setBaseUrl",t]);var r=document,s=r.createElement("script"),a=r.getElementsByTagName("script")[0];s.type="text/javascript",s.async=!0,s.src=t+"/static/scripts/rph.js",a.parentNode.insertBefore(s,a)}();
//Get your key from https://rownd.io/product-hunt
_rphConfig.push(['setAppKey', 'REPLACE_WITH_ROWND_APP_KEY']);

Trigger auth

Trigger authentication from a button

Add this snippet to your existing <script> tag in the footer to have the Rownd Hub trigger an authentication modal when a particular button or text is clicked.
//Ensure this is AFTER the main snippet
_rphConfig.push(['onLoaded', () => {
const loginButton = document.querySelector('#REPLACE_WITH_HTML_SELECTOR_FOR_BUTTON');
loginButton.addEventListener('click', (evt) => {
       //this delays the forward / action until after auth
//Rownd sign in request

Turn an Email field and button into a login

Turn any field into a login

Create an email or phone number login using your existing forms.
Add this snippet to the existing <script> in the footer
_rphConfig.push(['onLoaded', () => {
           // Get new value from button click
           const button = document.querySelector('REPLACE_WITH_BUTTON_HTML_SELECTOR');
           button.addEventListener('click', (evt) => {
               const newEmail = document.querySelector('REPLACE_WITH_FORM_INPUT_HTML_SELECTOR').value;
// This example uses email, you can utilize SMS with 'phone_number'
               rownd.user.setValue('email', newEmail);
               // rownd.requestSignIn will automatically kick off a validation
               rownd.requestSignIn({ auto_sign_in: true, identifier: newEmail });

Add Form data to the HUB

Add more complex form data to Rownd

It all starts with a snippet.
Add this snippet to the footer of your website (right before the </body> tag).
_rphConfig.push(['onLoaded', () => {
           // Note: ROWND_DATA_TYPES are specific to rownd.  List below
           const button = document.querySelector('#REPLACE_WITH_BUTTON_HTML_SELECTOR');
           button.addEventListener('click', (evt) => {
               const newDATATYPE1= document.querySelector('DATATYPE1_INPUT_HTML_SELECTOR').value;
               rownd.user.setValue('DATATYPE1', newREPLACEWITHDATATYPE1);

               //Second data type
               const newDATATYPE2= document.querySelector('DATATYPE2_INPUT_HTML_SELECTOR').value;
               rownd.user.setValue('DATATYPE2', newREPLACEWITHDATATYPE2);

               //Third data type
               const newDATATYPE3= document.querySelector('DATATYPE3_INPUT_HTML_SELECTOR').value;
               rownd.user.setValue('DATATYPE3', newREPLACEWITHDATATYPE2);

               //If you choose, you can also validate at this point as well, just ensure you are collecting email as one of the datatypes

               //rownd.requestSignIn will automatically kick off a validation
               //rownd.requestSignIn({ auto_sign_in: true, identifier: newEmail });
Customize your site

Add customizations across your site

The Rownd hub can use the profile data collected across your website on any page to create personalizations and customizations.
Check this out to see an example.
Data can be sent to and retrieved from the Rownd Hub. We are working on simplifying it and would love feedback.

You have to find the HTML Selector for each element
Video on how to do it: https://www.loom.com/share/be8d81a9e2384660818b8f4a279d9959

This is also added to the footer.  Always ensure these snippets are UNDER the website snippet
//Use Rownd Hubdata to Customize a page

<script type="text/javascript">
_rphConfig.push(['onLoaded', () => {
 rph.events.addEventListener('user_data', (e) => {

Change the email/text forward

Customize where users go after they authenticate

It all starts with a snippet.
Add this snippet to the footer of your website (right before the </body> tag).
//Where to after validation; the PATH can be relative (/welcome) or absolute (https://mysite.com/welcome)
_rphConfig.push(['setPostLoginRedirect', 'REPLACE_WITH_PATH_OF_REDIRECT']);

Other documentation:

How to find the footer in webflow
There are two ways to add code-snippets in Webflow.

The main Rownd snippet should be added at the site level. This is done through "Project Settings" and the custom code tab.

Individual, page specific customizations can be done at the page level.

Please read this for more information.
How do I utilize the hub profile data in the browser
The Rownd hub ships with a powerful in-browser API that makes it easy to customize and do some pretty powerful stuff

rownd.auth.token() - Get the token
rownd.user.get() - Get all profile data
rownd.user.getValue("first_name") - get just a particular data-type (in these next few cases, first_name, user_id, and last_name.  This is very useful when interacting with intercom, etc.
rownd.user.setValue("first_name", "REPLACE_WITH_VARIABLE") you can set a value with ease

There is a lot more and more comprehensive docs are coming soon.
What data types are included in Rownd
We automatically bootstrap about a dozen common data types. If you want to add more, please go to https://app.rownd.io, go to your app, and you can add new data types.

Bootstrapped data types: