Help with json metabase + embedding URL Node.js

Hi,

I don’t understand why, but I try to embed this dashboard in my application.

code:

cat package.json
var jwt = require(“jsonwebtoken”);

var METABASE_SITE_URL = “http://myserver.myserver.com:3000”;
var METABASE_SECRET_KEY = "db9a8cac9c5d3abe3b79dc46f0d47j8j8j8jd3d3d03dk03dk30;

var payload = {

  • resource: { dashboard: 1 },*
  • params: {},*
  • exp: Math.round(Date.now() / 1000) + (10 * 60) // 10 minute expiration*
    };
    var token = jwt.sign(payload, METABASE_SECRET_KEY);

var iframeUrl = METABASE_SITE_URL + “/embed/dashboard/” + token + “#bordered=true&titled=true”;

This error: Any suggestion?

npm install jsonwebtoken
npm ERR! Linux 3.10.0-957.5.1.el7.x86_64
npm ERR! argv “/usr/bin/node” “/bin/npm” “install” “jsonwebtoken”
npm ERR! node v6.17.1
npm ERR! npm v3.10.10
npm ERR! file /var/www/html/glpi/plugins/metabase/reports/package.json
npm ERR! code EJSONPARSE

npm ERR! Failed to parse json
npm ERR! Unexpected token ‘v’ at 1:1
npm ERR! var jwt = require(“jsonwebtoken”);
npm ERR! ^
npm ERR! File: /var/www/html/glpi/plugins/metabase/reports/package.json
npm ERR! Failed to parse package.json data.
npm ERR! package.json must be actual JSON, not just JavaScript.
npm ERR!
npm ERR! This is not a bug in npm.
npm ERR! Tell the package author to fix their package.json file. JSON.parse

npm ERR! Please include the following file with any support request:
npm ERR! /var/www/html/glpi/plugins/metabase/reports/npm-debug.log

I look my error, the name of file isn’t package.json, but is node.js