Pass filters into embed dashboards

I had created an minimal test using metabase + postgres where i have a table like this

create table if not exists "example" (
  "id" serial not null primary key,
  "name" varchar(100) not null,
  "age" int not null default 0
)

And I create an dashboard with simple query like this:

select * 
from "example"
where 1 = 1
[[ and "name" ~  {{name}} ]]

In the question the variable is working, In the dashboard the filter is connected with variable of question and it working but when tryed to create an embbed dashboard using them, i the parameters not working.

My example code is like this:

import express from 'express';
import jsonwebtoken from 'jsonwebtoken';

const URL = '{{METABASE_URL}}';
const KEY = '{{METABASE_KEY}}';
const PORT = 3000;

const app = express();

app.get('/embed', (req, res) => {
  const payload = {
    resource: {dashboard: 4},
    params: req.query,
    exp: Math.round(Date.now() / 1000) + 10 * 60,
  };
  const token = jsonwebtoken.sign(payload, KEY);
  const iframeUrl = `${URL}/embed/dashboard/${token}#bordered=true&titled=true`;
  const htmlContent = `
  <!DOCTYPE html>
  <html lang="en">
    <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>Test Metabase</title>
    </head>
    <body>
      <iframe
        src="${iframeUrl}"
        frameborder="0"
        style="width: 100%; height: 100vh;"
        allowfullscreen 
        allowtransparency>
      </iframe>
    </body>
  </html>
  `;
  res.send(htmlContent);
});

app.listen(PORT, () => {
  console.log(`Server is running on http://localhost:${ENV.PORT}`);
});

Someone can help me? It's possible to pass filters to embed dashboards?

What's the result of that code snippet?

If you access the endpoint "http://localhost:3000/embed" you will have the rendered dashboard containing the question correctly but when you access the endpoint passing a querystring like "http://localhost:3000/embed?name=John" the question crashes returning error like this:

and looking for the console log the iframe throws an error like "Unknown parameter :name."

When access the same dashboard by public URL and pass the parameter as query string "name=John" in url it's works

Have you published the dashboard for embed? Viewed the sample code that's generated when published?

yes, so that it is working if I access the endpoint "http://localhost:3000/embed" without passing any arguments

please send the frontend and backend logs, metabase version... etc