Skip to content

Commit 1dcd4fa

Browse files
authored
fix: adds setNonce to TFormbricks type and jsdoc comments (#29)
* adds setNonce to TFormbricks type and jsdoc comments * tweak * tweak * tweak * updates dependencies and package.json version for minor release * updates lock file * tweak
1 parent a50155a commit 1dcd4fa

File tree

4 files changed

+112
-75
lines changed

4 files changed

+112
-75
lines changed

apps/playground/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
"clean": "rimraf .turbo node_modules dist coverage"
1212
},
1313
"dependencies": {
14-
"lucide-react": "0.559.0",
15-
"next": "16.0.8",
16-
"react": "19.2.1",
17-
"react-dom": "19.2.1"
14+
"lucide-react": "0.561.0",
15+
"next": "16.0.10",
16+
"react": "19.2.3",
17+
"react-dom": "19.2.3"
1818
},
1919
"devDependencies": {
2020
"@eslint/eslintrc": "^3",

packages/js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@formbricks/js",
33
"license": "MIT",
4-
"version": "4.2.1",
4+
"version": "4.3.0",
55
"description": "Formbricks-js allows you to connect your index to Formbricks, display surveys and trigger events.",
66
"homepage": "https://formbricks.com",
77
"repository": {

packages/js/src/types/formbricks.ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,71 @@ export interface TFormbricks {
77
attributes?: Record<string, string>;
88
}) => Promise<void>;
99

10+
/**
11+
* @description Initializes the Formbricks SDK.
12+
* @param setupConfig - The configuration for the Formbricks SDK.
13+
*/
1014
setup: (setupConfig: {
1115
environmentId: string;
1216
appUrl: string;
1317
}) => Promise<void>;
1418

19+
/**
20+
* @description Sets the email of the user.
21+
* @param email - The email of the user.
22+
*/
1523
setEmail: (email: string) => Promise<void>;
1624

25+
/**
26+
* @description Sets an attribute of the user.
27+
* @param key - The key of the attribute.
28+
* @param value - The value of the attribute.
29+
*/
1730
setAttribute: (key: string, value: string) => Promise<void>;
1831

32+
/**
33+
* @description Sets multiple attributes of the user.
34+
* @param attributes - The attributes to set.
35+
*/
1936
setAttributes: (attributes: Record<string, string>) => Promise<void>;
2037

38+
/**
39+
* @description Sets the language of the user.
40+
* @param language - The language of the user.
41+
*/
2142
setLanguage: (language: string) => Promise<void>;
2243

44+
/**
45+
* @description Sets the user ID.
46+
* @param userId - The user ID to set.
47+
*/
2348
setUserId: (userId: string) => Promise<void>;
2449

50+
/**
51+
* @description Sets the CSP nonce for inline styles
52+
* @param nonce - The CSP nonce value (without 'nonce-' prefix), or undefined to clear
53+
*/
54+
setNonce: (nonce: string | undefined) => Promise<void>;
55+
56+
/**
57+
* @description Tracks an event.
58+
* @param code - The code of the event.
59+
* @param properties - The properties of the event.
60+
*/
2561
track: (
2662
code: string,
2763
properties?: {
2864
hiddenFields: Record<string | number, string | number | string[]>;
2965
}
3066
) => Promise<void>;
3167

68+
/**
69+
* @description Logs out the user
70+
*/
3271
logout: () => Promise<void>;
3372

73+
/**
74+
* @description Registers a route change.
75+
*/
3476
registerRouteChange: () => Promise<void>;
3577
}

pnpm-lock.yaml

Lines changed: 65 additions & 70 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)