Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

12.3 KB
Raw Blame
---
title: MetabaseProvider
layout: docs-api
redirect_from:
  - /docs/latest/embedding/api/MetabaseProvider
---

<!DOCTYPE html><html class="default" lang="en" data-base="./"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>MetabaseProvider | Embedded analytics SDK API</title><link rel="icon" href="assets/favicon.ico"/>{% include docs/embedded-analytics-sdk-metadata.html %}<meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="assets/style.css"/><link rel="stylesheet" href="assets/highlight.css"/><link rel="stylesheet" href="assets/custom.css"/><script defer src="assets/main.js"></script><script defer src="assets/custom.js"></script><script async src="assets/icons.js" id="tsd-icons-script"></script><script async src="assets/search.js" id="tsd-search-script"></script><script async src="assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="index.html" class="title">Embedded analytics SDK API</a><div id="tsd-toolbar-links"><a href="javascript:navigateBack({ fallbackUrl: '/docs/latest/embedding/sdk/introduction' })">Back to documentation</a></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="" aria-current="page">MetabaseProvider</a></li></ul><h1>Function MetabaseProvider</h1></div><section class="tsd-panel"><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="metabaseprovider"><span class="tsd-kind-call-signature">MetabaseProvider</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">props</span><span class="tsd-signature-symbol">:</span> <a href="MetabaseProviderProps.html" class="tsd-signature-type tsd-kind-interface">MetabaseProviderProps</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react/index.d.ts#L436" class="tsd-signature-type external" target="_blank">ReactNode</a><a href="#metabaseprovider" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>A component that provides the Metabase SDK context and theme.</p>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">props</span>: <a href="MetabaseProviderProps.html" class="tsd-signature-type tsd-kind-interface">MetabaseProviderProps</a></span><ul class="tsd-parameters"><li class="tsd-parameter"><h5 id="allowconsolelog"><code class="tsd-tag">Optional</code><span class="tsd-kind-property">allowConsoleLog</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span></h5><div class="tsd-comment tsd-typography"><p>Whether to allow logging to the DevTools console. Defaults to true.</p>
</div></li><li class="tsd-parameter"><h5 id="allowedcustomvisualizations"><code class="tsd-tag">Optional</code><span class="tsd-kind-property">allowedCustomVisualizations</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-symbol">`</span><span class="tsd-signature-type">custom:</span><span class="tsd-signature-symbol">${</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">`</span><span class="tsd-signature-symbol">[]</span></h5><div class="tsd-comment tsd-typography"><p>Opt-in support for EE custom visualization plugins inside the SDK.</p>
<p>Pass an allowlist of <code>custom:</code>-prefixed plugin identifiers (manifest
<code>name</code>), e.g. <code>[&quot;custom:Thumbs&quot;, &quot;custom:Calendar&quot;]</code>. Only
listed plugins are loaded. Omit or pass <code>[]</code> to disable.</p>
<p>Requires the <code>custom-viz</code> premium feature.</p>
</div></li><li class="tsd-parameter"><h5 id="authconfig"><span class="tsd-kind-property">authConfig</span><span class="tsd-signature-symbol">: </span><a href="MetabaseAuthConfig.html" class="tsd-signature-type tsd-kind-type-alias">MetabaseAuthConfig</a></h5><div class="tsd-comment tsd-typography"><p>Defines how to authenticate with Metabase.</p>
</div></li><li class="tsd-parameter"><h5 id="children"><span class="tsd-kind-property">children</span><span class="tsd-signature-symbol">: </span><a href="https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react/index.d.ts#L436" class="tsd-signature-type external" target="_blank">ReactNode</a></h5><div class="tsd-comment tsd-typography"><p>The children of the MetabaseProvider component.</p>
</div></li><li class="tsd-parameter"><h5 id="classname"><code class="tsd-tag">Optional</code><span class="tsd-kind-property">className</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>A custom class name to be added to the root element.</p>
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-deprecated"><h4 class="tsd-anchor-link" id="deprecated">Deprecated<a href="#deprecated" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h4><p>This prop is not used anymore.</p>
</div></div></li><li class="tsd-parameter"><h5 id="customvisualizationssandboxurl"><code class="tsd-tag">Optional</code><span class="tsd-kind-property">customVisualizationsSandboxUrl</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>URL of an empty HTML page that custom visualizations run in. Use it when
your page's Content Security Policy does not allow <code>'unsafe-eval'</code>.</p>
<p>The page must be served from the same origin as your app, with its own
<code>Content-Security-Policy: default-src 'none'; script-src 'unsafe-eval'</code>.</p>
</div></li><li class="tsd-parameter"><h5 id="errorcomponent"><code class="tsd-tag">Optional</code><span class="tsd-kind-property">errorComponent</span><span class="tsd-signature-symbol">?: </span><a href="SdkErrorComponent.html" class="tsd-signature-type tsd-kind-type-alias">SdkErrorComponent</a></h5><div class="tsd-comment tsd-typography"><p>A custom error component to display when the SDK encounters an error.</p>
</div></li><li class="tsd-parameter"><h5 id="eventhandlers"><code class="tsd-tag">Optional</code><span class="tsd-kind-property">eventHandlers</span><span class="tsd-signature-symbol">?: </span><a href="SdkEventHandlersConfig.html" class="tsd-signature-type tsd-kind-type-alias">SdkEventHandlersConfig</a></h5><div class="tsd-comment tsd-typography"><p>See <a href="https://www.metabase.com/docs/latest/embedding/config#handle-embed-events-react-sdk-only">Handle embed events</a>.</p>
</div></li><li class="tsd-parameter"><h5 id="loadercomponent"><code class="tsd-tag">Optional</code><span class="tsd-kind-property">loaderComponent</span><span class="tsd-signature-symbol">?: </span><a href="https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react/index.d.ts#L124" class="tsd-signature-type external" target="_blank">ComponentType</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">label</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">&gt;</span></h5><div class="tsd-comment tsd-typography"><p>A custom loader component to display while the SDK is loading.</p>
<p>The component receives an optional <code>label</code> prop that can be used to display a loading message.</p>
</div></li><li class="tsd-parameter"><h5 id="locale"><code class="tsd-tag">Optional</code><span class="tsd-kind-property">locale</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Defines the display language. Accepts an ISO language code such as <code>en</code> or <code>de</code>.
Defaults to the instance locale.</p>
</div></li><li class="tsd-parameter"><h5 id="pluginsconfig"><code class="tsd-tag">Optional</code><span class="tsd-kind-property">pluginsConfig</span><span class="tsd-signature-symbol">?: </span><a href="MetabaseGlobalPluginsConfig.html" class="tsd-signature-type tsd-kind-type-alias">MetabaseGlobalPluginsConfig</a></h5><div class="tsd-comment tsd-typography"><p>See <a href="https://www.metabase.com/docs/latest/embedding/sdk/plugins">Plugins</a>.</p>
</div></li><li class="tsd-parameter"><h5 id="theme"><code class="tsd-tag">Optional</code><span class="tsd-kind-property">theme</span><span class="tsd-signature-symbol">?: </span><a href="MetabaseEmbeddingTheme.html" class="tsd-signature-type tsd-kind-type-alias">MetabaseEmbeddingTheme</a></h5><div class="tsd-comment tsd-typography"><p>See <a href="https://www.metabase.com/docs/latest/embedding/appearance">Appearance</a>.</p>
</div></li><li class="tsd-parameter"><h5 id="uselegacymonolithicbundle"><code class="tsd-tag">Optional</code><span class="tsd-kind-property">useLegacyMonolithicBundle</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span></h5><div class="tsd-comment tsd-typography"><p>Whether to load the full SDK bundle directly as a single file (legacy behavior),
instead of the optimized bootstrap that loads chunks in parallel and starts
authentication early.</p>
<p>Defaults to false (uses the optimized bootstrap loader).</p>
</div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <a href="https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react/index.d.ts#L436" class="tsd-signature-type external" target="_blank">ReactNode</a></h4></div></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav id="tsd-sidebar-links" class="tsd-navigation"><a href="javascript:navigateBack({ fallbackUrl: '/docs/latest/embedding/sdk/introduction' })" class="tsd-nav-link">Back to documentation</a></nav><nav class="tsd-navigation"><a href="index.html">Embedded analytics SDK API</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p><script type="text/javascript" src="/gdpr-cookie-notice/dist/script.js"></script><script type="text/javascript" src="/js/cookie-consent.js"></script><link href="/gdpr-cookie-notice/dist/style.css" rel="stylesheet" /><link href="/css/gdpr.css" rel="stylesheet" /></p></footer><div class="overlay"></div></body></html>