@encatch/web-sdk 1.0.1 → 1.1.0-beta.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/dist/index.d.ts +12 -0
- package/package.json +8 -9
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
*/
|
|
4
4
|
declare type Command = [string, ...unknown[]];
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Context values that can be attached to a form submission.
|
|
8
|
+
* Date values are automatically serialized to ISO strings before being sent.
|
|
9
|
+
*/
|
|
10
|
+
declare type ContextValue = string | number | Date | boolean;
|
|
11
|
+
|
|
6
12
|
declare const _encatch: EncatchSDK;
|
|
7
13
|
export { _encatch }
|
|
8
14
|
export default _encatch;
|
|
@@ -174,6 +180,12 @@ export declare interface ShowFormOptions {
|
|
|
174
180
|
* @default 'always'
|
|
175
181
|
*/
|
|
176
182
|
reset?: ResetMode;
|
|
183
|
+
/**
|
|
184
|
+
* Arbitrary key-value pairs attached to the form submission.
|
|
185
|
+
* Useful for passing caller-side metadata (e.g. plan tier, feature flag states).
|
|
186
|
+
* Date values are automatically serialized to ISO 8601 strings.
|
|
187
|
+
*/
|
|
188
|
+
context?: Record<string, ContextValue>;
|
|
177
189
|
}
|
|
178
190
|
|
|
179
191
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@encatch/web-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.1.0-beta.0",
|
|
4
4
|
"description": "A lightweight, type-safe JavaScript SDK for integrating Encatch forms and surveys",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/encatch.es.js",
|
|
@@ -32,13 +32,6 @@
|
|
|
32
32
|
"user-feedback",
|
|
33
33
|
"web-sdk"
|
|
34
34
|
],
|
|
35
|
-
"scripts": {
|
|
36
|
-
"dev": "vite build --watch",
|
|
37
|
-
"build": "vite build",
|
|
38
|
-
"clean": "rm -rf dist",
|
|
39
|
-
"typecheck": "tsc --noEmit",
|
|
40
|
-
"prepublishOnly": "npm run build"
|
|
41
|
-
},
|
|
42
35
|
"devDependencies": {
|
|
43
36
|
"typescript": "^5.9.3",
|
|
44
37
|
"vite": "^7.3.1",
|
|
@@ -53,5 +46,11 @@
|
|
|
53
46
|
"license": "MIT",
|
|
54
47
|
"engines": {
|
|
55
48
|
"node": ">=18"
|
|
49
|
+
},
|
|
50
|
+
"scripts": {
|
|
51
|
+
"dev": "vite build --watch",
|
|
52
|
+
"build": "vite build",
|
|
53
|
+
"clean": "rm -rf dist",
|
|
54
|
+
"typecheck": "tsc --noEmit"
|
|
56
55
|
}
|
|
57
|
-
}
|
|
56
|
+
}
|