Skip to content
Snippets Groups Projects
Commit 12d8c6ed authored by Sameer Al-Sakran's avatar Sameer Al-Sakran
Browse files

move things around

parent c734fa83
No related branches found
Tags embedding-sdk-0.1.37
No related merge requests found
## Embedding Metabase in other Applications
## Embedding Metabase in other applications
Metabase includes a powerful application embedding feature that allows you to embed your saved questions or dashboards in your own web applications. You can even pass parameters to these embeds to customize them for different users.
### Key Concepts
#### Applications
An important distinction to keep in mind is the difference between Metabase and the embedding application. The charts and dashboards you will be embedding live in the Metabase application, and will be embedded in your (i.e. the embedding application).
An important distinction to keep in mind is the difference between Metabase and the embedding application. The charts and dashboards you will be embedding live in the Metabase application, and will be embedded in your application (i.e. the embedding application).
#### Parameters
Some dashboards, and questions have the ability to accept parameters. In dashboards, these are synnomous with dashboard filters. For example, if you have a dashboard with a filter on Publisher ID, this can be supplied as a filter when embedding, so that you could insert the dashboard filtered down to a specific Publisher ID.
Some dashboards and questions have the ability to accept parameters. In dashboards, these are synonymous with dashboard filters. For example, if you have a dashboard with a filter on Publisher ID, this can be specified as a parameter when embedding, so that you could insert the dashboard filtered down to a specific Publisher ID.
SQL based questions with template variables can also accept parameters for each variable. So for a query like
```
......@@ -19,7 +20,7 @@ you could specify a specific productID when embedding the question.
#### Signed parameters
In general, when embedding a chart or dashboard, the server of your embedding application will need to sign a request for that resource.
If you choose to sign a specific parameter value, that means the user can't modify that, nor is a filter widget displayed for that parameter. For example, if the "Publisher ID" is assigned a value and the request signed, that means the frontend client that renders that dashboard on behalf of a given logged-in user can only see information for that publisher ID.
If you choose to sign a specific parameter value, that means the user can't modify that, nor is a filter widget displayed for that parameter. For example, if the "Publisher ID" is assigned a value and the request signed, that means the front-end client that renders that dashboard on behalf of a given logged-in user can only see information for that publisher ID.
### Enabling embedding
To enable embedding, go to the Admin Panel and under Settings, go to the "Embedding in other applications" tab. From there, click "Enable." Here you will see a secret signing key you can use later to sign requests. If you ever need to invalidate that key and generate a new one, just click on "Regenerate Key".
......@@ -29,7 +30,7 @@ You can also see all questions and dashboards that have been marked as "Embeddab
Once you've enabled the embedding feature on your Metabase instance, you should then go to the individual questions and dashboards you wish to embed to set them up for embedding.
### Embedding Charts + Dashboards
### Embedding Charts and Dashboards
To mark a given question or dashboard, click on the sharing icon
......@@ -39,19 +40,19 @@ Then select "Embed this question in an application"
![Enable sharing for a question](images/embedding/03-enable-question.png)
Here you will see a preview of the question or dashboard as it will appear in your application, as well as a panel that whos you the code you will need to insert in your application.
Here you will see a preview of the question or dashboard as it will appear in your application, as well as a panel that shows you the code you will need to insert in your application.
![Preview](images/embedding/04-preview.png)
Importantly, you will need to hit "Publish" when you first set up a chart or dashboard for embedding and each time you change it. Also, any changes you make to the resource might require you to update the code in your own application to the latest code sample in the "Code Pane".
Importantly, you will need to hit "Publish" when you first set up a chart or dashboard for embedding and each time you embedding settings. Also, any changes you make to the resource might require you to update the code in your own application to the latest code sample in the "Code Pane".
![Code samples for embedding](images/embedding/05-code.png)
We provide code samples for common front end template languages as well as some common backend web frameworks and languages. You may also use these as starting points for writing your own versions in other platforms.
We provide code samples for common front end template languages as well as some common back-end web frameworks and languages. You may also use these as starting points for writing your own versions in other platforms.
### Embedding Charts + Dashboards with locked parameters
If you wish to have a parameter locked down, to prevent your embedding application end users from seeing other users data, you can mark parameters as "Locked". Once a parameter is marked as Locked, it is not displayed as a filter widget, and must be set by the embedding application's server code.
### Embedding Charts and Dashboards with locked parameters
If you wish to have a parameter locked down to prevent your embedding application's end users from seeing other users' data, you can mark parameters as "Locked."Once a parameter is marked as Locked, it is not displayed as a filter widget, and must be set by the embedding application's server code.
![Locked parameters](images/embedding/06-locked.png)
......
......@@ -15,6 +15,7 @@ Are you in charge of managing Metabase for your organization? Then you're in the
* [Setting up Slack integration](09-setting-up-slack.md)
* [Enabling single sign-on with Google](10-single-sign-on.md)
* [Creating a Getting Started Guide for your team](11-getting-started-guide.md)
* [Embedding Metabase in other Applications](13-embedding.md)
First things first, you'll need to install Metabase. If you haven’t done that yet, our [Installation Guide](../operations-guide/start.md#installing-and-running-metabase) will help you through the process.
......
......@@ -14,6 +14,5 @@
* [Get answers in Slack with Metabot](10-metabot.md)
* [Some helpful tips on building your data model](11-data-model-reference.md)
* [Creating SQL Templates](12-sql-parameters.md)
* [Embedding Metabase in other Applications](13-embedding.md)
Let's get started with an overview of [What Metabase does](01-what-is-metabase.md).
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment