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