@salesforce/ui-bundle-template-feature-react-customer-web-client-chat 11.52.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.
Files changed (107) hide show
  1. package/LICENSE.txt +82 -0
  2. package/README.md +63 -0
  3. package/dist/.forceignore +15 -0
  4. package/dist/.husky/pre-commit +4 -0
  5. package/dist/.prettierignore +11 -0
  6. package/dist/.prettierrc +17 -0
  7. package/dist/CHANGELOG.md +4553 -0
  8. package/dist/README.md +77 -0
  9. package/dist/config/project-scratch-def.json +13 -0
  10. package/dist/eslint.config.js +7 -0
  11. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/.forceignore +15 -0
  12. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/.graphqlrc.yml +2 -0
  13. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/.prettierignore +9 -0
  14. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/.prettierrc +11 -0
  15. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/CHANGELOG.md +10 -0
  16. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/README.md +75 -0
  17. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/codegen.yml +95 -0
  18. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/components.json +18 -0
  19. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/e2e/app.spec.ts +17 -0
  20. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/eslint.config.js +169 -0
  21. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/feature-react-customer-web-client-chat.uibundle-meta.xml +7 -0
  22. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/index.html +12 -0
  23. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/package.json +76 -0
  24. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/playwright.config.ts +24 -0
  25. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/scripts/get-graphql-schema.mjs +71 -0
  26. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/scripts/rewrite-e2e-assets.mjs +23 -0
  27. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/api/graphqlClient.ts +44 -0
  28. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/app.tsx +17 -0
  29. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/appLayout.tsx +83 -0
  30. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/assets/icons/book.svg +3 -0
  31. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/assets/icons/copy.svg +4 -0
  32. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/assets/icons/rocket.svg +3 -0
  33. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/assets/icons/star.svg +3 -0
  34. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/assets/images/codey-1.png +0 -0
  35. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/assets/images/codey-2.png +0 -0
  36. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/assets/images/codey-3.png +0 -0
  37. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/assets/images/vibe-codey.svg +194 -0
  38. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/components/CustomerWebClientChat.tsx +74 -0
  39. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/components/alerts/status-alert.tsx +52 -0
  40. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/components/layouts/card-layout.tsx +29 -0
  41. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/components/ui/alert.tsx +76 -0
  42. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/components/ui/avatar.tsx +109 -0
  43. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/components/ui/badge.tsx +48 -0
  44. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/components/ui/breadcrumb.tsx +109 -0
  45. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/components/ui/button.tsx +67 -0
  46. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/components/ui/calendar.tsx +232 -0
  47. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/components/ui/card.tsx +103 -0
  48. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/components/ui/checkbox.tsx +32 -0
  49. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/components/ui/collapsible.tsx +33 -0
  50. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/components/ui/datePicker.tsx +127 -0
  51. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/components/ui/dialog.tsx +162 -0
  52. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/components/ui/dropdown-menu.tsx +257 -0
  53. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/components/ui/field.tsx +237 -0
  54. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/components/ui/index.ts +109 -0
  55. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/components/ui/input.tsx +19 -0
  56. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/components/ui/label.tsx +22 -0
  57. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/components/ui/pagination.tsx +132 -0
  58. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/components/ui/popover.tsx +89 -0
  59. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/components/ui/select.tsx +193 -0
  60. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/components/ui/separator.tsx +26 -0
  61. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/components/ui/skeleton.tsx +14 -0
  62. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/components/ui/sonner.tsx +20 -0
  63. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/components/ui/spinner.tsx +16 -0
  64. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/components/ui/table.tsx +121 -0
  65. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/components/ui/tabs.tsx +88 -0
  66. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/hooks/useAsyncData.ts +67 -0
  67. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/index.ts +6 -0
  68. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/lib/utils.ts +6 -0
  69. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/navigationMenu.tsx +80 -0
  70. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/pages/Home.tsx +12 -0
  71. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/pages/NotFound.tsx +18 -0
  72. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/pages/TestChatPage.tsx +26 -0
  73. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/router-utils.tsx +35 -0
  74. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/routes.tsx +28 -0
  75. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/styles/global.css +135 -0
  76. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/types/chat.ts +36 -0
  77. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/tsconfig.json +45 -0
  78. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/tsconfig.node.json +13 -0
  79. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/tsconfig.tsbuildinfo +1 -0
  80. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/ui-bundle.json +7 -0
  81. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/vite-env.d.ts +4 -0
  82. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/vite.config.ts +106 -0
  83. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/vitest-env.d.ts +2 -0
  84. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/vitest.config.ts +11 -0
  85. package/dist/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/vitest.setup.ts +1 -0
  86. package/dist/jest.config.js +6 -0
  87. package/dist/package-lock.json +10066 -0
  88. package/dist/package.json +46 -0
  89. package/dist/scripts/apex/hello.apex +10 -0
  90. package/dist/scripts/gitignore-templates.json +4 -0
  91. package/dist/scripts/graphql-search.sh +191 -0
  92. package/dist/scripts/org-setup-config-schema.mjs +120 -0
  93. package/dist/scripts/org-setup-dev.mjs +87 -0
  94. package/dist/scripts/org-setup-utils.mjs +569 -0
  95. package/dist/scripts/org-setup-xml.mjs +182 -0
  96. package/dist/scripts/org-setup.config.json +5 -0
  97. package/dist/scripts/org-setup.mjs +2345 -0
  98. package/dist/scripts/sf-project-setup.mjs +103 -0
  99. package/dist/scripts/soql/account.soql +6 -0
  100. package/dist/scripts/validate-org-setup-config.mjs +38 -0
  101. package/dist/sfdx-project.json +12 -0
  102. package/package.json +51 -0
  103. package/src/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/components/CustomerWebClientChat.tsx +74 -0
  104. package/src/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/index.ts +6 -0
  105. package/src/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/pages/TestChatPage.tsx +26 -0
  106. package/src/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/routes.tsx +23 -0
  107. package/src/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/types/chat.ts +36 -0
@@ -0,0 +1,103 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Run from SFDX project root: install dependencies, build, and launch the dev server
4
+ * for the UI bundle in force-app/main/default/uiBundles/.
5
+ *
6
+ * Usage: npm run sf-project-setup
7
+ * (from the directory that contains force-app/ and sfdx-project.json)
8
+ */
9
+
10
+ import { spawnSync } from 'node:child_process';
11
+ import { resolve, dirname } from 'node:path';
12
+ import { fileURLToPath } from 'node:url';
13
+ import { readdirSync, existsSync, readFileSync, writeFileSync } from 'node:fs';
14
+
15
+ const __dirname = dirname(fileURLToPath(import.meta.url));
16
+ const ROOT = resolve(__dirname, '..');
17
+
18
+ /**
19
+ * npm strips .gitignore from published packages — generate them on first run.
20
+ * Templates are stored in scripts/gitignore-templates.json (generated at build
21
+ * time from the actual .gitignore files). The JSON may not exist in git-cloned
22
+ * distributions where .gitignore is already present, so loading is best-effort.
23
+ */
24
+ function loadGitignoreTemplates() {
25
+ const templatesPath = resolve(__dirname, 'gitignore-templates.json');
26
+ if (!existsSync(templatesPath)) return null;
27
+ try {
28
+ return JSON.parse(readFileSync(templatesPath, 'utf8'));
29
+ } catch {
30
+ return null;
31
+ }
32
+ }
33
+
34
+ function ensureGitignore(dir, content) {
35
+ if (!content) return;
36
+ const gitignorePath = resolve(dir, '.gitignore');
37
+ if (!existsSync(gitignorePath)) {
38
+ writeFileSync(gitignorePath, content, 'utf8');
39
+ console.log(`Created .gitignore in ${dir}`);
40
+ }
41
+ }
42
+
43
+ function resolveUIBundlesDir() {
44
+ const sfdxPath = resolve(ROOT, 'sfdx-project.json');
45
+ if (!existsSync(sfdxPath)) {
46
+ console.error('Error: sfdx-project.json not found at project root.');
47
+ process.exit(1);
48
+ }
49
+ const sfdxProject = JSON.parse(readFileSync(sfdxPath, 'utf8'));
50
+ const pkgDir = sfdxProject?.packageDirectories?.[0]?.path;
51
+ if (!pkgDir) {
52
+ console.error('Error: No packageDirectories[].path found in sfdx-project.json.');
53
+ process.exit(1);
54
+ }
55
+ return resolve(ROOT, pkgDir, 'main', 'default', 'uiBundles');
56
+ }
57
+
58
+ function discoverUIBundleDir() {
59
+ const uiBundlesDir = resolveUIBundlesDir();
60
+ if (!existsSync(uiBundlesDir)) {
61
+ console.error(`Error: uiBundles directory not found: ${uiBundlesDir}`);
62
+ process.exit(1);
63
+ }
64
+ const entries = readdirSync(uiBundlesDir, { withFileTypes: true });
65
+ const dirs = entries.filter((e) => e.isDirectory() && !e.name.startsWith('.'));
66
+ if (dirs.length === 0) {
67
+ console.error(`Error: No UI bundle folder found under ${uiBundlesDir}`);
68
+ process.exit(1);
69
+ }
70
+ if (dirs.length > 1) {
71
+ console.log(`Multiple UI bundles found; using first: ${dirs[0].name}`);
72
+ }
73
+ return resolve(uiBundlesDir, dirs[0].name);
74
+ }
75
+
76
+ function run(label, cmd, args, opts) {
77
+ console.log(`\n--- ${label} ---\n`);
78
+ const result = spawnSync(cmd, args, { stdio: 'inherit', ...opts });
79
+ if (result.status !== 0) {
80
+ process.exit(result.status ?? 1);
81
+ }
82
+ }
83
+
84
+ // Ensure .gitignore files exist (npm strips them from published packages).
85
+ const gitignoreTemplates = loadGitignoreTemplates();
86
+ if (gitignoreTemplates) {
87
+ ensureGitignore(ROOT, gitignoreTemplates.sfdx);
88
+ const bundlesDir = resolveUIBundlesDir();
89
+ if (existsSync(bundlesDir)) {
90
+ for (const entry of readdirSync(bundlesDir, { withFileTypes: true })) {
91
+ if (entry.isDirectory() && !entry.name.startsWith('.')) {
92
+ ensureGitignore(resolve(bundlesDir, entry.name), gitignoreTemplates.webapp);
93
+ }
94
+ }
95
+ }
96
+ }
97
+
98
+ const uiBundleDir = discoverUIBundleDir();
99
+ console.log('SFDX project root:', ROOT);
100
+ console.log('UI bundle directory:', uiBundleDir);
101
+
102
+ run('npm install', 'npm', ['install', '--registry', 'https://registry.npmjs.org/'], { cwd: uiBundleDir });
103
+ run('npm run build', 'npm', ['run', 'build'], { cwd: uiBundleDir });
@@ -0,0 +1,6 @@
1
+ // Use .soql files to store SOQL queries.
2
+ // You can execute queries in VS Code by selecting the
3
+ // query text and running the command:
4
+ // SFDX: Execute SOQL Query with Currently Selected Text
5
+
6
+ SELECT Id, Name FROM Account
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Build / CI gate: validate this package's org-setup.config.json against the
3
+ * shared schema (W-23043729, spec §5.2).
4
+ *
5
+ * Ships inside the SFDX project template, so a generated app can self-check its
6
+ * org-setup.config.json in its own CI:
7
+ * npm run validate:org-setup-config
8
+ *
9
+ * Uses the SAME validateConfig + schema as org-setup.mjs runtime, so build-time
10
+ * and runtime checks can never drift. A missing config file is OK (not every
11
+ * project ships one); a present-but-invalid config fails the gate.
12
+ */
13
+
14
+ import { existsSync, readFileSync } from 'node:fs';
15
+ import { resolve, dirname } from 'node:path';
16
+ import { fileURLToPath } from 'node:url';
17
+
18
+ import { validateConfig } from './org-setup-config-schema.mjs';
19
+
20
+ const __dirname = dirname(fileURLToPath(import.meta.url));
21
+ const configPath = resolve(__dirname, 'org-setup.config.json');
22
+
23
+ if (!existsSync(configPath)) {
24
+ console.log('✓ org-setup.config.json: not present (nothing to validate)');
25
+ process.exit(0);
26
+ }
27
+
28
+ const result = validateConfig(readFileSync(configPath, 'utf8'), configPath);
29
+ if (result.ok) {
30
+ console.log('✓ org-setup.config.json');
31
+ process.exit(0);
32
+ }
33
+
34
+ console.error('❌ org-setup.config.json is invalid:');
35
+ for (const err of result.errors) {
36
+ console.error(` - ${err}`);
37
+ }
38
+ process.exit(1);
@@ -0,0 +1,12 @@
1
+ {
2
+ "packageDirectories": [
3
+ {
4
+ "path": "force-app",
5
+ "default": true
6
+ }
7
+ ],
8
+ "name": "MyProject",
9
+ "namespace": "",
10
+ "sfdcLoginUrl": "https://login.salesforce.com",
11
+ "sourceApiVersion": "67.0"
12
+ }
package/package.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "@salesforce/ui-bundle-template-feature-react-customer-web-client-chat",
3
+ "version": "11.52.0",
4
+ "description": "Embedded Customer Web Client (Embedded Messaging) chat feature for UI Bundles",
5
+ "license": "SEE LICENSE IN LICENSE.txt",
6
+ "author": "",
7
+ "type": "module",
8
+ "main": "src/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/index.ts",
9
+ "types": "src/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/index.ts",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./src/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/index.ts",
13
+ "import": "./src/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/index.ts",
14
+ "default": "./src/force-app/main/default/uiBundles/feature-react-customer-web-client-chat/src/index.ts"
15
+ }
16
+ },
17
+ "files": [
18
+ "dist",
19
+ "src",
20
+ "rules"
21
+ ],
22
+ "publishConfig": {
23
+ "access": "public"
24
+ },
25
+ "scripts": {
26
+ "clean": "rm -rf dist"
27
+ },
28
+ "devDependencies": {
29
+ "@types/react": "^19.2.7",
30
+ "@types/react-dom": "^19.2.3",
31
+ "react": "^19.2.1",
32
+ "react-dom": "^19.2.1",
33
+ "react-router": "^8.0.0"
34
+ },
35
+ "nx": {
36
+ "targets": {
37
+ "build": {
38
+ "executor": "@salesforce/ui-bundle-template-cli:apply-patches"
39
+ },
40
+ "watch": {
41
+ "executor": "@salesforce/ui-bundle-template-cli:watch-patches"
42
+ },
43
+ "build:dist-app": {
44
+ "executor": "@salesforce/ui-bundle-template-cli:build-dist-app"
45
+ },
46
+ "dev": {
47
+ "executor": "@salesforce/ui-bundle-template-cli:dev-server"
48
+ }
49
+ }
50
+ }
51
+ }
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+
7
+ import { useEffect } from "react";
8
+ import type { CustomerWebClientChatProps, WindowWithCwcProperties } from "../types/chat";
9
+
10
+ /**
11
+ * React wrapper that embeds the Customer Web Client (Embedded Messaging) chat
12
+ * widget into an external site. It dynamically loads the site's
13
+ * `embeddedservice_bootstrap` script and calls `init` with the org, deployment,
14
+ * site, and SCRT2 configuration. Renders nothing itself — the chat UI is a
15
+ * floating widget injected by the bootstrap script.
16
+ */
17
+ export function CustomerWebClientChat({
18
+ orgId,
19
+ deploymentName,
20
+ siteURL,
21
+ scrt2URL,
22
+ language = "en",
23
+ devMode = false,
24
+ }: CustomerWebClientChatProps) {
25
+ useEffect(() => {
26
+ if (typeof window === "undefined") return;
27
+ if (
28
+ !orgId ||
29
+ !deploymentName ||
30
+ !siteURL ||
31
+ !scrt2URL ||
32
+ !(orgId.length === 15 || orgId.length === 18)
33
+ ) {
34
+ console.warn("[CustomerWebClientChat] missing required config; skipping init");
35
+ return;
36
+ }
37
+
38
+ const win = window as WindowWithCwcProperties;
39
+ const bootstrapSrc = `${siteURL}/assets/js/bootstrap.js`;
40
+ const existing = document.querySelector<HTMLScriptElement>(`script[src="${bootstrapSrc}"]`);
41
+ const script: HTMLScriptElement = existing ?? document.createElement("script");
42
+
43
+ const init = () => {
44
+ try {
45
+ if (!win.embeddedservice_bootstrap) return;
46
+ win.embeddedservice_bootstrap.settings.language = language;
47
+ if (devMode) win.embeddedservice_bootstrap.settings.devMode = true;
48
+ win.embeddedservice_bootstrap.init(orgId, deploymentName, siteURL, {
49
+ scrt2URL,
50
+ });
51
+ } catch (err) {
52
+ console.error("Error loading Embedded Messaging: ", err);
53
+ }
54
+ };
55
+
56
+ if (existing) {
57
+ if (win.embeddedservice_bootstrap) init();
58
+ else existing.addEventListener("load", init, { once: true });
59
+ } else {
60
+ script.type = "text/javascript";
61
+ script.src = bootstrapSrc;
62
+ script.addEventListener("load", init, { once: true });
63
+ document.body.appendChild(script);
64
+ }
65
+
66
+ return () => {
67
+ script.removeEventListener("load", init);
68
+ };
69
+ }, [orgId, deploymentName, siteURL, scrt2URL, language, devMode]);
70
+
71
+ return null;
72
+ }
73
+
74
+ export default CustomerWebClientChat;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * feature-react-customer-web-client-chat – Customer Web Client (Embedded Messaging) chat
3
+ */
4
+
5
+ export { CustomerWebClientChat } from "./components/CustomerWebClientChat";
6
+ export type { CustomerWebClientChatProps } from "./types/chat";
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+
7
+ import CustomerWebClientChat from "../components/CustomerWebClientChat";
8
+
9
+ export default function TestChatPage() {
10
+ return (
11
+ <div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
12
+ <div className="text-center">
13
+ <h1 className="text-4xl font-bold text-gray-900 mb-4">Chat</h1>
14
+ <p className="text-lg text-gray-600 mb-8">
15
+ Welcome to your Customer Web Client chat application.
16
+ </p>
17
+ </div>
18
+ <CustomerWebClientChat
19
+ orgId="<ORG_ID_15_OR_18_CHAR_00D...>"
20
+ deploymentName="<EMBEDDED_SERVICE_DEPLOYMENT_NAME>"
21
+ siteURL="<SITE_URL>"
22
+ scrt2URL="<SCRT2_URL>"
23
+ />
24
+ </div>
25
+ );
26
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+
7
+ import type { RouteObject } from "react-router";
8
+ import AppLayout from "./__inherit__appLayout";
9
+ import TestChatPage from "./pages/TestChatPage";
10
+
11
+ export const routes: RouteObject[] = [
12
+ {
13
+ path: "/",
14
+ element: <AppLayout />,
15
+ children: [
16
+ {
17
+ path: "test-chat",
18
+ element: <TestChatPage />,
19
+ handle: { showInNavigation: true, label: "Test Chat" },
20
+ },
21
+ ],
22
+ },
23
+ ];
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+
7
+ /** Shape of the Embedded Messaging bootstrap global injected by the site's bootstrap.js. */
8
+ export interface WindowWithCwcProperties extends Window {
9
+ embeddedservice_bootstrap?: {
10
+ settings: {
11
+ language: string;
12
+ devMode?: boolean;
13
+ };
14
+ init: (
15
+ orgId: string,
16
+ deploymentName: string,
17
+ siteURL: string,
18
+ options: { scrt2URL: string },
19
+ ) => void;
20
+ };
21
+ }
22
+
23
+ export interface CustomerWebClientChatProps {
24
+ /** The organization id (15- or 18-char Salesforce id starting with `00D`). */
25
+ orgId: string;
26
+ /** The Embedded Service deployment / channel name the agent is connected to. */
27
+ deploymentName: string;
28
+ /** The ESW site URL. Usually contains `ESW` and the deployment name. */
29
+ siteURL: string;
30
+ /** The SCRT2 (Service Cloud Real-Time) chat service URL. Usually contains `scrt`. */
31
+ scrt2URL: string;
32
+ /** Optional chat language. Defaults to `"en"`. */
33
+ language?: string;
34
+ /** Optional. Enables Embedded Messaging dev mode. Defaults to `false`. */
35
+ devMode?: boolean;
36
+ }