@omni-co/embed 0.2.1 → 0.2.3

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
@@ -1,28 +1,89 @@
1
- # omni-embed-sdk
1
+ # Omni Embed SSO Typescript SDK
2
2
 
3
- ## ⚠️ OmniEmbedSDK uses NPM! ⚠️
3
+ ## Install
4
4
 
5
- Publishing to npmjs.org was complicated with Yarn. Until that issue is resolved, please use NPM to manage this package.
5
+ npm:
6
+ ```
7
+ npm install @omni-co/embed
8
+ ```
6
9
 
7
- ## Installation
10
+ yarn:
11
+ ```
12
+ yarn add @omni-co/embed
13
+ ```
8
14
 
9
- 1. git clone the repository
10
- 2. `npm install`
11
- 3. `npm run test`
15
+ ## Basic Example
12
16
 
13
- ## Publishing
17
+ ```ts
18
+ import { embedSsoDashboard } from '@omni-co/embed'
14
19
 
15
- 1. Create a new branch
16
- 2. Edit the package.json version number appropriately
17
- 3. Open a PR
18
- 4. Merge the PR
19
- 5. Nav to the Releases page in Github: https://github.com/exploreomni/embed-sdk/releases
20
- 6. Click "Draft new Release"
21
- 7. Click "Choose a tag" and type in the new tag name. Convention is to prefix the new version with `v`. Example: `v1.0.0`
22
- 8. Leave target as `main`
23
- 9. Enter a title, usually just the release version eg `v1.0.0`
24
- 10. Add a description
25
- 11. Ensure `Set as latest release` is ticked, if that's appropriate
26
- 12. Click `Publish release`
20
+ // This creates a signed embed sso link for a dashboard
21
+ // in the omni account named Acme.
22
+ const iframeUrl = embedSsoDashboard({
23
+ contentId: "miU0hL6z",
24
+ externalId: "wile.e@coyote.co",
25
+ name: "Wile E",
26
+ organizationName: "acme",
27
+ secret: "abcdefghijklmnopqrstuvwxyz123456",
28
+ });
29
+ ```
27
30
 
28
- 🥳 - The [github action defined here](https://github.com/exploreomni/embed-sdk/blob/main/.github/workflows/publish.yml) should publish the new release to npmjs.org.
31
+ ## Kitchen Sink Example
32
+
33
+ ```ts
34
+ import { embedSsoDashboard } from '@omni-co/embed'
35
+
36
+ // This creates a signed embed sso link for a dashboard
37
+ // in the omni account named Acme.
38
+ const iframeUrl = embedSsoDashboard({
39
+ contentId: "miU0hL6z",
40
+ externalId: "wile.e@coyote.co",
41
+ entity: "cartoon",
42
+ name: "Wile E",
43
+ organizationName: "acme",
44
+ secret: "abcdefghijklmnopqrstuvwxyz123456",
45
+ prefersDark: "system",
46
+ theme: "vibes",
47
+ userAttributes: { tool: "anvil" }
48
+ });
49
+ ```
50
+
51
+ ## embedSsoDashboard
52
+
53
+ This is the type signature for the embedSsoDashboard function:
54
+
55
+ ```ts
56
+ type EmbedSsoDashboardProps = {
57
+ // Short GUID of the dashboard. Can be obtained via the dashboard's url.
58
+ contentId: string;
59
+
60
+ // Required identifier to associate the external user with an
61
+ // automatically generated internal Omni user.
62
+ externalId: string;
63
+
64
+ // Required name of the external user.
65
+ name: string;
66
+
67
+ // Required Omni organization which contains the dashboard.
68
+ organizationName: string;
69
+
70
+ // Signing secret available to Omni admins.
71
+ secret: string;
72
+
73
+ // Optional identifier to associate the user with an external
74
+ // organization or system.
75
+ entity?: string;
76
+
77
+ // Optional user attributes to be passed to user associated with the
78
+ // externalId. User attributes must be created in Omni before being
79
+ // defined and given a value here.
80
+ userAttributes?: Record<string, string>;
81
+
82
+ // Optional dark mode setting. Can be one of "true", "false", or "system".
83
+ prefersDark?: string;
84
+
85
+ // Optional theme setting. Can be one of "dawn", "vibes", "breeze" or "blank".
86
+ theme?: string;
87
+ };
88
+
89
+ ```
@@ -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 {};
@@ -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
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.2.1",
2
+ "version": "0.2.3",
3
3
  "license": "MIT",
4
4
  "name": "@omni-co/embed",
5
5
  "author": "Nate Agrin <nate@exploreomni.com>",