@omni-co/embed 0.3.0 → 0.3.1
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 +31 -30
- package/lib/cjs/embed.d.ts +2 -1
- package/lib/esm/embed.d.ts +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,11 +3,13 @@
|
|
|
3
3
|
## Install
|
|
4
4
|
|
|
5
5
|
npm:
|
|
6
|
+
|
|
6
7
|
```
|
|
7
8
|
npm install @omni-co/embed
|
|
8
9
|
```
|
|
9
10
|
|
|
10
11
|
yarn:
|
|
12
|
+
|
|
11
13
|
```
|
|
12
14
|
yarn add @omni-co/embed
|
|
13
15
|
```
|
|
@@ -15,37 +17,37 @@ yarn add @omni-co/embed
|
|
|
15
17
|
## Basic Example
|
|
16
18
|
|
|
17
19
|
```ts
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
20
|
+
import { embedSsoDashboard } from "@omni-co/embed";
|
|
21
|
+
|
|
22
|
+
// This creates a signed embed sso link for a dashboard
|
|
23
|
+
// in the omni account named Acme.
|
|
24
|
+
const iframeUrl = await embedSsoDashboard({
|
|
25
|
+
contentId: "miU0hL6z",
|
|
26
|
+
externalId: "wile.e@coyote.co",
|
|
27
|
+
name: "Wile E",
|
|
28
|
+
organizationName: "acme",
|
|
29
|
+
secret: "abcdefghijklmnopqrstuvwxyz123456",
|
|
30
|
+
});
|
|
29
31
|
```
|
|
30
32
|
|
|
31
33
|
## Kitchen Sink Example
|
|
32
34
|
|
|
33
35
|
```ts
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
36
|
+
import { embedSsoDashboard } from "@omni-co/embed";
|
|
37
|
+
|
|
38
|
+
// This creates a signed embed sso link for a dashboard
|
|
39
|
+
// in the omni account named Acme.
|
|
40
|
+
const iframeUrl = await embedSsoDashboard({
|
|
41
|
+
contentId: "miU0hL6z",
|
|
42
|
+
externalId: "wile.e@coyote.co",
|
|
43
|
+
entity: "cartoon",
|
|
44
|
+
name: "Wile E",
|
|
45
|
+
organizationName: "acme",
|
|
46
|
+
secret: "abcdefghijklmnopqrstuvwxyz123456",
|
|
47
|
+
prefersDark: "system",
|
|
48
|
+
theme: "vibes",
|
|
49
|
+
userAttributes: { tool: "anvil" },
|
|
50
|
+
});
|
|
49
51
|
```
|
|
50
52
|
|
|
51
53
|
## embedSsoDashboard
|
|
@@ -57,7 +59,7 @@ type EmbedSsoDashboardProps = {
|
|
|
57
59
|
// Short GUID of the dashboard. Can be obtained via the dashboard's url.
|
|
58
60
|
contentId: string;
|
|
59
61
|
|
|
60
|
-
// Required identifier to associate the external user with an
|
|
62
|
+
// Required identifier to associate the external user with an
|
|
61
63
|
// automatically generated internal Omni user.
|
|
62
64
|
externalId: string;
|
|
63
65
|
|
|
@@ -70,14 +72,14 @@ type EmbedSsoDashboardProps = {
|
|
|
70
72
|
// Signing secret available to Omni admins.
|
|
71
73
|
secret: string;
|
|
72
74
|
|
|
73
|
-
// Optional identifier to associate the user with an external
|
|
75
|
+
// Optional identifier to associate the user with an external
|
|
74
76
|
// organization or system.
|
|
75
77
|
entity?: string;
|
|
76
78
|
|
|
77
79
|
// Optional user attributes to be passed to user associated with the
|
|
78
80
|
// externalId. User attributes must be created in Omni before being
|
|
79
81
|
// defined and given a value here.
|
|
80
|
-
userAttributes?: Record<string, string>;
|
|
82
|
+
userAttributes?: Record<string, string | string[] | number | number[]>;
|
|
81
83
|
|
|
82
84
|
// Optional dark mode setting. Can be one of "true", "false", or "system".
|
|
83
85
|
prefersDark?: string;
|
|
@@ -85,5 +87,4 @@ type EmbedSsoDashboardProps = {
|
|
|
85
87
|
// Optional theme setting. Can be one of "dawn", "vibes", "breeze" or "blank".
|
|
86
88
|
theme?: string;
|
|
87
89
|
};
|
|
88
|
-
|
|
89
90
|
```
|
package/lib/cjs/embed.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
type UserAttributeValue = string | string[] | number | number[];
|
|
1
2
|
type EmbedSsoProps = {
|
|
2
3
|
contentId: string;
|
|
3
4
|
externalId: string;
|
|
@@ -5,7 +6,7 @@ type EmbedSsoProps = {
|
|
|
5
6
|
organizationName: string;
|
|
6
7
|
secret: string;
|
|
7
8
|
entity?: string;
|
|
8
|
-
userAttributes?: Record<string,
|
|
9
|
+
userAttributes?: Record<string, UserAttributeValue>;
|
|
9
10
|
prefersDark?: string;
|
|
10
11
|
theme?: string;
|
|
11
12
|
domain?: string;
|
package/lib/esm/embed.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
type UserAttributeValue = string | string[] | number | number[];
|
|
1
2
|
type EmbedSsoProps = {
|
|
2
3
|
contentId: string;
|
|
3
4
|
externalId: string;
|
|
@@ -5,7 +6,7 @@ type EmbedSsoProps = {
|
|
|
5
6
|
organizationName: string;
|
|
6
7
|
secret: string;
|
|
7
8
|
entity?: string;
|
|
8
|
-
userAttributes?: Record<string,
|
|
9
|
+
userAttributes?: Record<string, UserAttributeValue>;
|
|
9
10
|
prefersDark?: string;
|
|
10
11
|
theme?: string;
|
|
11
12
|
domain?: string;
|
package/package.json
CHANGED