Install Featurebase SDK, etc

Automatically sign in your users & link their data to feedback

By using our SDK, you can automatically log users into Featurebase for a seamless experience.

It also syncs your user data, so you can see who's giving you feedback and filter by user attributes, such as monthly spend.

https://developers.featurebase.app/install

To set it up, simply add the following code to your app:

HTML

<!-- Import Featurebase SDK -->

<script>!(function(e,t){const a="featurebase-sdk";function n(){if(!t.getElementById(a)){var e=t.createElement("script");(e.id=a),(e.src="https://do.featurebase.app/js/sdk.js"),t.getElementsByTagName("script")[0].parentNode.insertBefore(e,t.getElementsByTagName("script")[0])}}"function"!=typeof e.Featurebase&&(e.Featurebase=function(){(e.Featurebase.q=e.Featurebase.q||[]).push(arguments)}),"complete"===t.readyState||"interactive"===t.readyState?n():t.addEventListener("DOMContentLoaded",n)})(window,document);</script>

<!-- Identify user in Featurebase -->

<script>

Featurebase(

        "identify",

        {

          // Each 'identify' call should include an "organization" property,

          // which is your Featurebase board's name before the ".featurebase.app".

          organization: "riskadvisor",



          // Required. Replace with your customers data.

          email: "yourcustomer@example.com",

          name: "Your Customer",

          id: "123456",



          // Optional

          profilePicture:

            "https://example.com/images/yourcustomer.png"

        },

        (err) => {

          // Callback function. Called when identify completed.

          if (err) {

            // console.error(err);

          } else {

            // console.log("Data sent successfully!");

          }

        }

      );

</script>

Vue

<script setup lang="ts">
import { onMounted, onBeforeMount } from "vue";

onBeforeMount(() => {
  const script = document.createElement("script");
  script.src = "https://do.featurebase.app/js/sdk.js";
  script.id = "featurebase-sdk";
  document.head.appendChild(script);
});

onMounted(() => {
  const win: any = window;

  if (typeof win.Featurebase !== "function") {
    win.Featurebase = function () {
      (win.Featurebase.q = win.Featurebase.q || []).push(arguments);
    };
  }
  win.Featurebase(
        "identify",
        {
          // Each 'identify' call should include an "organization" property,
          // which is your Featurebase board's name before the ".featurebase.app".
          organization: "riskadvisor",

          // Required. Replace with your customers data.
          email: "yourcustomer@example.com",
          name: "Your Customer",
          id: "123456",

          // Optional
          profilePicture:
            "https://example.com/images/yourcustomer.png"
        },
        (err) => {
          // Callback function. Called when identify completed.
          if (err) {
            // console.error(err);
          } else {
            // console.log("Data sent successfully!");
          }
        }
      );

});
</script>

<template>
  <main>
    <p>Your Component</p>
  </main>
</template>

Please authenticate to join the conversation.

Upvoters
Status

πŸ”₯ Released

Board

πŸ’‘ Feature Request

Date

Over 2 years ago

Author

Linear

Subscribe to post

Get notified by email when there are changes.