@omni-co/embed 0.3.0-pre.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -19,7 +19,7 @@ yarn add @omni-co/embed
19
19
 
20
20
  // This creates a signed embed sso link for a dashboard
21
21
  // in the omni account named Acme.
22
- const iframeUrl = embedSsoDashboard({
22
+ const iframeUrl = await embedSsoDashboard({
23
23
  contentId: "miU0hL6z",
24
24
  externalId: "wile.e@coyote.co",
25
25
  name: "Wile E",
@@ -35,7 +35,7 @@ yarn add @omni-co/embed
35
35
 
36
36
  // This creates a signed embed sso link for a dashboard
37
37
  // in the omni account named Acme.
38
- const iframeUrl = embedSsoDashboard({
38
+ const iframeUrl = await embedSsoDashboard({
39
39
  contentId: "miU0hL6z",
40
40
  externalId: "wile.e@coyote.co",
41
41
  entity: "cartoon",
@@ -5,10 +5,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.TEST_ONLY = exports.getSignature = exports.hmacSign = void 0;
7
7
  const crypto_1 = __importDefault(require("crypto"));
8
+ const base64url_1 = __importDefault(require("base64url"));
8
9
  const hmacSign = (data, secret) => {
9
10
  const hmac = crypto_1.default.createHmac("sha256", secret);
10
11
  hmac.update(data);
11
- return hmac.digest("base64url");
12
+ const b64 = hmac.digest("base64");
13
+ return base64url_1.default.fromBase64(b64);
12
14
  };
13
15
  exports.hmacSign = hmacSign;
14
16
  const generateStringForSignature = ({ loginUrl, contentPath, externalId, name, nonce, userAttributes, entity, prefersDark, theme, }) => {
@@ -1,8 +1,10 @@
1
1
  import crypto from "crypto";
2
+ import base64url from "base64url";
2
3
  export const hmacSign = (data, secret) => {
3
4
  const hmac = crypto.createHmac("sha256", secret);
4
5
  hmac.update(data);
5
- return hmac.digest("base64url");
6
+ const b64 = hmac.digest("base64");
7
+ return base64url.fromBase64(b64);
6
8
  };
7
9
  const generateStringForSignature = ({ loginUrl, contentPath, externalId, name, nonce, userAttributes, entity, prefersDark, theme, }) => {
8
10
  const optionalParams = [];
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.3.0-pre.2",
2
+ "version": "0.3.0",
3
3
  "license": "MIT",
4
4
  "name": "@omni-co/embed",
5
5
  "author": "Nate Agrin <nate@exploreomni.com>",
@@ -19,6 +19,7 @@
19
19
  "test:watch": "vitest --watch"
20
20
  },
21
21
  "dependencies": {
22
+ "base64url": "^3.0.1",
22
23
  "nanoid": "^5.0.2"
23
24
  },
24
25
  "engines": {