The token should be a guest token, fetched from your backend based on the current user’s login information. You can follow the document below for guest token generation.Here is an example with sample token and dashboardId that you can use in your frontend app to get started without a backend.
Import the library main or index or App or layout file
import '@databrainhq/plugin/web';
Once the library is imported, the web-components dbn-dashboard, dbn-metrics are available to use anywhere inside your app. And you can use it anywhere in your app like:
const Example = () => { return ( <dbn-dashboard token="Your Guest Token" dashboard-id="Your Dashboard Id" is-hide-table-preview is-hide-chart-settings enable-download-csv enable-email-csv options-icon="kebab-menu-vertical" enable-multi-metric-filters disable-fullscreen theme-name="Name of the theme you want to apply from app settings ui theming" custom-messages={JSON.stringify({ tokenExpiry: "Some custom message you want to show here." })} options={JSON.stringify({ disableMetricCreation: false, disableMetricUpdation: false, disableMetricDeletion: false, disableLayoutCustomization: false, hideDashboardName: false, chartColors: [ 'violet', 'indigo', 'blue', 'green', 'yellow', 'orange', 'red', 'pink', 'gray', ], })} theme={JSON.stringify({})} /> );};