2017 © Pedro Peláez
 

library metabase-php

Embedding Metabase

image

ipeevski/metabase-php

Embedding Metabase

  • Friday, April 13, 2018
  • by ipeevski
  • Repository
  • 1 Watchers
  • 6 Stars
  • 79 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 7 Versions
  • 1217 % Grown

The README.md

Library to embed Metabase frames, (*1)

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, (*2)

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., (*3)

<?php
include 'vendor/autoload.php';

// The url of the metabase installation
$metabaseUrl = '[metabase_url]';
// The secret embed key from the admin settings screen
$metabaseKey = '[metabase_key]';
// The id of the dashboard (from the url)
$dashboardId = 1;
// Any parameters to pass to the dashboard
$params = ['date' => 'past26weeks'];

$metabase = new \Metabase\Embed($metabaseUrl, $metabaseKey);
// Generate the HTML to create an iframe with the embedded dashboard
echo $metabase->dashboardIframe($dashboardId, $params);

The Versions

13/04 2018

dev-master

9999999-dev https://github.com/ipeevski/metabase-php

Embedding Metabase

  Sources   Download

MIT

The Requires

 

metabase

13/04 2018

0.2.3

0.2.3.0 https://github.com/ipeevski/metabase-php

Embedding Metabase

  Sources   Download

MIT

The Requires

 

metabase

22/08 2017

0.2.2

0.2.2.0 https://github.com/cyberhorse/metabase-php

Embedding Metabase

  Sources   Download

MIT

The Requires

 

metabase

22/08 2017

0.2.1

0.2.1.0 https://github.com/cyberhorse/metabase-php

Embedding Metabase

  Sources   Download

MIT

The Requires

 

metabase

22/08 2017

0.2.0

0.2.0.0 https://github.com/cyberhorse/metabase-php

Embedding Metabase

  Sources   Download

MIT

The Requires

 

metabase

21/08 2017

0.1.1

0.1.1.0 https://github.com/cyberhorse/metabase-php

Embedding Metabase

  Sources   Download

MIT

The Requires

 

metabase

21/08 2017

0.1.0

0.1.0.0 https://github.com/cyberhorse/metabase-php

Embedding Metabase

  Sources   Download

MIT

The Requires

 

metabase