How can I embed grafana dashboards in web application?

I am new to Grafana, I created grafana dashboard in grafana cloud and now I want to show those dashboards in my website. how can I embed grafana dashboards in web application?

1 Like

@srikanthg doesnt matter you run self-hosted or cloud; method looks the same:

  • open desired dashboard,
  • click Share button near the dashboard name ( upper-left corner of the page ) ,
  • set options you like/need,
  • Copy the generated link
  • paste it as <img> on the website

I followed below steps but not worked

  • I clicked on share button and copy the link.
  • then included in html page like
  • when I open the file in the browser nothing showed.
    could you help me solving this?

sure :slight_smile: could you please show me html code of your web? The part where you pasted copied code.

below is th html code

<!doctype html>
<html lang="en">
<img src="">

thank you


You forgot to close IMG tag. Should be:
<img src=""></img>

it’ giving cors issue

@srikanthg excuse me for not writing sooner…

within your HTML, add <meta> section and add the following:
Set-Cookie: Value=_ga,; SameSite=None; Secure;

within <head> section of your html file. Whole HTML file will look ( moreless ) like this:

		<!-- Cookie #1 -->
		<meta http-equiv="set-cookie" content="Value=_ga,; SameSite=None; Secure;"/>
		<!-- Cookie #2 -->
		<meta http-equiv="set-cookie" content="Value=_gid,; SameSite=None; Secure;"/>
		<!-- Other things like title etc -->
		<img src=""></img>

He. is it possible to use embedded frame with authorisation? Cause when i didn’t allow anonymous access in grafana ini i can only see grafana login window into frame?
I’ve tried to use something like this

          headers: {
            Authorization: "Basic YW50aG9ueTpPwf4Nzd29yZA==",
      .then((response) => {

but without success, still got a login window

Did you get a solution for this issue?

1 Like

Did you ever get a resolution to this? We are looking to embed some Grafana elements with authorization, can this be done with an API key or basic authentication? We are running Grafana v7.5.12 (NA) and I see that JWT has a method for versions 8+

Is it even possible to use iframe with authentification?

How to embed variables?

Hi all (and @therealman )

It is possible to have embedded dashboards in 3rd party web apps using authentication, but it isn’t our recommendation that you do that. To see all of your options, the pros / cons, and why we don’t recommend that option (and security issues associated with it) - this post has the full run-down.