https://github.com/ipeevski/metabase-php
Library to embed Metabase frames
https://github.com/ipeevski/metabase-php
metabase
Last synced: 6 months ago
JSON representation
Library to embed Metabase frames
- Host: GitHub
- URL: https://github.com/ipeevski/metabase-php
- Owner: ipeevski
- License: mit
- Created: 2017-08-21T06:08:55.000Z (almost 9 years ago)
- Default Branch: main
- Last Pushed: 2023-05-18T02:17:08.000Z (about 3 years ago)
- Last Synced: 2025-11-27T15:10:44.000Z (8 months ago)
- Topics: metabase
- Language: PHP
- Homepage:
- Size: 21.5 KB
- Stars: 24
- Watchers: 3
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-metabase - Metabase PHP - PHP API wrapper (Related Third Party Projects / Unofficial and Third Party Examples)
README
Library to embed [Metabase](http://www.metabase.com/) frames
# Installation
- Install via composer
`composer require ipeevski/metabase-php`
- Go to Metabase and enable embedding - https://[metabase_url]/admin/settings/embedding_in_other_applications
- Note down the Metabase base url and the Embedding secret key
# Usage
## Basic usage
First, you need to find the dashboard or question you want to embed. Note down the id - it would be at the end of the URL (for example https://[metabase_url]/dashboard/1?date=past26weeks
Note the integer after /dashboard/ - that's the ID of the dashboard.
Also note the GET parameters at the end of the url - those are parameters you might want to pass to the dashboard too.
```
'past26weeks'];
$metabase = new \Metabase\Embed($metabaseUrl, $metabaseKey);
// Generate the HTML to create an iframe with the embedded dashboard
echo $metabase->dashboardIframe($dashboardId, $params);
```