Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions apps/playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
"clean": "rimraf .turbo node_modules dist coverage"
},
"dependencies": {
"lucide-react": "0.559.0",
"next": "16.0.8",
"react": "19.2.1",
"react-dom": "19.2.1"
"lucide-react": "0.561.0",
"next": "16.0.10",
"react": "19.2.3",
"react-dom": "19.2.3"
},
"devDependencies": {
"@eslint/eslintrc": "^3",
Expand Down
2 changes: 1 addition & 1 deletion packages/js/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@formbricks/js",
"license": "MIT",
"version": "4.2.1",
"version": "4.3.0",
"description": "Formbricks-js allows you to connect your index to Formbricks, display surveys and trigger events.",
"homepage": "https://formbricks.com",
"repository": {
Expand Down
42 changes: 42 additions & 0 deletions packages/js/src/types/formbricks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,71 @@ export interface TFormbricks {
attributes?: Record<string, string>;
}) => Promise<void>;

/**
* @description Initializes the Formbricks SDK.
* @param setupConfig - The configuration for the Formbricks SDK.
*/
setup: (setupConfig: {
environmentId: string;
appUrl: string;
}) => Promise<void>;

/**
* @description Sets the email of the user.
* @param email - The email of the user.
*/
setEmail: (email: string) => Promise<void>;

/**
* @description Sets an attribute of the user.
* @param key - The key of the attribute.
* @param value - The value of the attribute.
*/
setAttribute: (key: string, value: string) => Promise<void>;

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

/**
* @description Sets the language of the user.
* @param language - The language of the user.
*/
setLanguage: (language: string) => Promise<void>;

/**
* @description Sets the user ID.
* @param userId - The user ID to set.
*/
setUserId: (userId: string) => Promise<void>;

/**
* @description Sets the CSP nonce for inline styles
* @param nonce - The CSP nonce value (without 'nonce-' prefix), or undefined to clear
*/
setNonce: (nonce: string | undefined) => Promise<void>;

/**
* @description Tracks an event.
* @param code - The code of the event.
* @param properties - The properties of the event.
*/
track: (
code: string,
properties?: {
hiddenFields: Record<string | number, string | number | string[]>;
}
) => Promise<void>;

/**
* @description Logs out the user
*/
logout: () => Promise<void>;

/**
* @description Registers a route change.
*/
registerRouteChange: () => Promise<void>;
}
135 changes: 65 additions & 70 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.