@@ -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}
0 commit comments