AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Metabase doc3/16/2024 ![]() ![]() In the bottom code block, get the sample code for your frontend.Previewing the frontend code for an embed Make sure to copy these changes to your actual server code. When you make changes to the style, appearance, or parameter preview settings, the server code sample will update as well. Optional: Select your web framework from the dropdown menu.In the top code block, you’ll find the sample code for your web server.Add the frontend code to the HTML file where you want your static embed to appear.įor more examples, see our reference apps repo.Add the server code to the file that builds your website.Go to the question or dashboard > sharing icon > Embed this item in an application.Once you’ve made a question or dashboard embeddable, you’ll need to put the embedding URL for that question or dashboard on your website: Metabase_site_url/embed/question/your_jwt_token?parameter_name=value It’s generated by your web server using your Metabase site URL, signed JWT, and parameters: The embedding URL for a question or dashboard is the Metabase URL that’ll be displayed in your website’s iframe. Optional: Preview the appearance of the embed.Select Embed this item in an application.Click on the sharing icon (square with an arrow pointing to the top right).Go to the question or dashboard that you want to embed in your website.Making a question or dashboard embeddable Go to Settings > Admin settings > Embedding.Enabling the embedding feature in Metabase If you want to embed charts with additional interactive features, like drill-down and self-service querying, see Interactive embedding. Note that this secret key is shared for all static embeds, so whoever has access to that key will have access to all embedded artifacts. The secret key tells Metabase that the request for filtered data can be trusted, so it’s safe to display the results at the new embedding URL. The signed JWT is generated using your Metabase secret key. Your_metabase_embedding_url/your_signed_jwt?filter=true For example, if a website visitor enters the value “true” in an embedded filter widget, your web server will generate a new embedding URL with an extra parameter: To ask for updated data from Metabase, your web server will generate a new Metabase embedding URL. If you want to set up interactive Metabase filters in your iframe, your web server will need to make requests to Metabase for updated data each time a website visitor updates the filter widget. To restrict data in static embeds for specific people or groups, set up locked parameters instead. For those features, check out interactive embedding. You can can’t use static embeds with data sandboxes, drill-through or auditing tools because signed JWTs don’t create user sessions (server-side sessions). The JWT also includes a reference to the resource to load, e.g., the dashboard ID, and any values for locked parameters. Metabase will only load the URL if the request supplies a JWT signed with the secret shared between your app and your Metabase. A static embed (or signed embed) is an iframe that’s loading a Metabase URL secured with a signed JSON Web Token (JWT). In general, embedding works by displaying a Metabase URL inside an iframe in your website. If a foreign key relationship exists in your database, but doesn’t show up in your Metabase, your Metabase admin will need to update your Metabase Table Metadata.Also known as: standalone embedding, or signed embedding. In the data reference sidebar, under Connections, you can find a list of table relationships (defined by foreign keys). If you click on a column you’re interested in, you’ll see a description of its contents, as well as a list of sample values for columns that don’t have a huge number of distinct values. Each table or column will only contain a description if your admin wrote something in the Table Metadata section of the Admin Panel. This panel lists all the databases you have access to, and the models and tables, and the fields inside of them.Ĭlick on the model or table you would like to explore further to see a description of it and a list of all the columns it has. To bring up the data reference panel in the native/SQL editor, click on the open book icon. That’s where the Data reference comes in handy. Sometimes when you’re writing a query, you might forget the exact names of different tables or columns, or which table contains what. The data reference section is a great place to find information about the data types of columns in your data. The data reference is a collection of pages organized by database, then tables in that database (the same structure you use to pick data). Hovering over a table in the data browser and clicking on the book icon that appears.The Metabase sidebar > Browse data > Learn about our data. ![]()
0 Comments
Read More
Leave a Reply. |