guidewhale 0.1.6 → 0.1.7

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,6 +1,8 @@
1
- # guide-whale-sdk-test
1
+ # GuideWhale Client Script
2
2
 
3
- GuideWhale client installation using npm. The module exports a
3
+ GuideWhale client installation using npm. The module exports a `guidewhale` object, which is used to reference all of our SDK methods.
4
+
5
+ The script is automatically loaded when the module is imported. Any methods that are called before the script is loaded will be queued and executed after the script finishes loading.
4
6
 
5
7
  ## Installation
6
8
 
@@ -9,21 +11,35 @@ npm install guidewhale
9
11
  ```
10
12
 
11
13
  ## Usage
14
+ Simply import gwhale object from 'guidewhale' package and replace placeholder values with your environment token and user/company properties (remove any non-required properties if you don't need them) as shown below:
12
15
 
13
16
  ```typescript
14
- import { greet } from 'guide-whale-sdk-test';
15
-
16
- console.log(greet('World')); // Output: Hello, World!
17
+ import { gwhale } from 'guidewhale';
18
+
19
+ gwhale.init("<guidewhale_environment_code>", {
20
+ user: {
21
+ user_id: <user_id>, // REQUIRED - unique user identifier (e.g. 100000356, '6099047b-660b-4f2e-a878-fb66a12c1840', 'john.smith@example.com')
22
+ email: <user_email>, // RECOMMENDED - email is used as the key to map user data for most integrations (e.g. 'john.smith@example.com')
23
+ first_name: <user_first_name>, // RECOMMENDED - can be used to personalize GuideWhale content (e.g. 'John')
24
+ last_name: <user_last_name>, // RECOMMENDED - can be used to personalize GuideWhale content (e.g. 'Smith')
25
+ date_signed_up: <user_signup_date>, // RECOMMENDED - can be used to selectively show checklists to new users (Must be ISO8601 string - e.g. "2024-01-01T12:00:00Z")
26
+ ... // OPTIONAL - additional user properties (e.g. gender: 'female')
27
+ },
28
+ company: {
29
+ company_id: <company_id>, // REQUIRED - unique company identifier (e.g. 100000356, '6099047b-660b-4f2e-a878-fb66a12c1840')
30
+ name: <company_name>, // RECOMMENDED - can be used to personalize GuideWhale content (e.g. 'GuideWhale Inc.')
31
+ plan: <company_subscription_plan>, // RECOMMENDED - can be used to target users for upselling, discounts, and promotions (e.g. 'free', 'basic', 'pro')
32
+ ... // OPTIONAL - additional company properties (e.g. location: 'United States')
33
+ },
34
+ membership: {
35
+ is_primary: <user_is_primary_contact>, // RECOMMENDED - whether user is the primary contact for the company (e.g. true, false)
36
+ role: <user_company_role>, // RECOMMENDED - you can target users based on their role in the company (e.g. 'admin', 'user', 'guest')
37
+ ... // OPTIONAL - additional user company membership properties (e.g. employee_number: 12345)
38
+ }
39
+ });
17
40
  ```
18
41
 
19
42
  ## Development
20
43
 
21
44
  1. Install dependencies: `npm install`
22
- 2. Make changes in `src/`
23
- 3. Build: `npm run build`
24
- 4. Test: `npm test`
25
-
26
- ## License
27
-
28
- MIT
29
- Repository to publish GuideWhale SDK as a public NPM package
45
+ 2. Build: `npm run build`
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "guidewhale",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "GuideWhale SDK client script loader",
5
5
  "type": "module",
6
- "main": "dist/index.js",
7
- "module": "dist/index.js",
8
- "types": "dist/index.d.ts",
6
+ "main": "dist/guidewhale.js",
7
+ "module": "dist/guidewhale.js",
8
+ "types": "dist/guidewhale.d.ts",
9
9
  "files": [
10
10
  "dist"
11
11
  ],
File without changes
File without changes
File without changes