@cometchat/skills-cli 2.0.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 (95) hide show
  1. package/README.md +70 -0
  2. package/bin/cometchat.mjs +7 -0
  3. package/dist/index.js +4395 -0
  4. package/dist/registry/schemas/template.schema.json +142 -0
  5. package/dist/registry/v6/experiences/1-conversation-list/astro.template.json +89 -0
  6. package/dist/registry/v6/experiences/1-conversation-list/nextjs-pages.template.json +83 -0
  7. package/dist/registry/v6/experiences/1-conversation-list/nextjs.template.json +83 -0
  8. package/dist/registry/v6/experiences/1-conversation-list/react-router.template.json +102 -0
  9. package/dist/registry/v6/experiences/1-conversation-list/reactjs.template.json +86 -0
  10. package/dist/registry/v6/experiences/1-conversation-list/templates/astro/ChatApp.css.tpl +39 -0
  11. package/dist/registry/v6/experiences/1-conversation-list/templates/astro/ChatApp.tsx.tpl +86 -0
  12. package/dist/registry/v6/experiences/1-conversation-list/templates/astro/CometChatSelector.tsx.tpl +40 -0
  13. package/dist/registry/v6/experiences/1-conversation-list/templates/astro/chat.astro.tpl +17 -0
  14. package/dist/registry/v6/experiences/1-conversation-list/templates/nextjs/CometChatNoSSR.css.tpl +39 -0
  15. package/dist/registry/v6/experiences/1-conversation-list/templates/nextjs/CometChatNoSSR.tsx.tpl +86 -0
  16. package/dist/registry/v6/experiences/1-conversation-list/templates/nextjs/CometChatSelector.tsx.tpl +41 -0
  17. package/dist/registry/v6/experiences/1-conversation-list/templates/nextjs/chat-page.tsx.tpl +11 -0
  18. package/dist/registry/v6/experiences/1-conversation-list/templates/nextjs-pages/CometChatNoSSR.css.tpl +39 -0
  19. package/dist/registry/v6/experiences/1-conversation-list/templates/nextjs-pages/CometChatNoSSR.tsx.tpl +88 -0
  20. package/dist/registry/v6/experiences/1-conversation-list/templates/nextjs-pages/CometChatSelector.tsx.tpl +41 -0
  21. package/dist/registry/v6/experiences/1-conversation-list/templates/nextjs-pages/chat-page.tsx.tpl +15 -0
  22. package/dist/registry/v6/experiences/1-conversation-list/templates/react-router/CometChat-route.tsx.tpl +22 -0
  23. package/dist/registry/v6/experiences/1-conversation-list/templates/react-router/CometChatNoSSR.css.tpl +39 -0
  24. package/dist/registry/v6/experiences/1-conversation-list/templates/react-router/CometChatNoSSR.tsx.tpl +87 -0
  25. package/dist/registry/v6/experiences/1-conversation-list/templates/react-router/CometChatSelector.tsx.tpl +40 -0
  26. package/dist/registry/v6/experiences/1-conversation-list/templates/reactjs/App.css.tpl +32 -0
  27. package/dist/registry/v6/experiences/1-conversation-list/templates/reactjs/App.tsx.tpl +55 -0
  28. package/dist/registry/v6/experiences/1-conversation-list/templates/reactjs/CometChatSelector.tsx.tpl +40 -0
  29. package/dist/registry/v6/experiences/1-conversation-list/templates/reactjs/main.tsx.tpl +46 -0
  30. package/dist/registry/v6/experiences/2-one-to-one/astro.template.json +81 -0
  31. package/dist/registry/v6/experiences/2-one-to-one/nextjs.template.json +77 -0
  32. package/dist/registry/v6/experiences/2-one-to-one/react-router.template.json +93 -0
  33. package/dist/registry/v6/experiences/2-one-to-one/reactjs.template.json +77 -0
  34. package/dist/registry/v6/experiences/2-one-to-one/templates/astro/ChatApp.css.tpl +21 -0
  35. package/dist/registry/v6/experiences/2-one-to-one/templates/astro/ChatApp.tsx.tpl +66 -0
  36. package/dist/registry/v6/experiences/2-one-to-one/templates/astro/chat.astro.tpl +17 -0
  37. package/dist/registry/v6/experiences/2-one-to-one/templates/nextjs/CometChatNoSSR.css.tpl +21 -0
  38. package/dist/registry/v6/experiences/2-one-to-one/templates/nextjs/CometChatNoSSR.tsx.tpl +66 -0
  39. package/dist/registry/v6/experiences/2-one-to-one/templates/nextjs/chat-page.tsx.tpl +11 -0
  40. package/dist/registry/v6/experiences/2-one-to-one/templates/react-router/CometChat-route.tsx.tpl +21 -0
  41. package/dist/registry/v6/experiences/2-one-to-one/templates/react-router/CometChatNoSSR.css.tpl +21 -0
  42. package/dist/registry/v6/experiences/2-one-to-one/templates/react-router/CometChatNoSSR.tsx.tpl +67 -0
  43. package/dist/registry/v6/experiences/2-one-to-one/templates/reactjs/App.css.tpl +4 -0
  44. package/dist/registry/v6/experiences/2-one-to-one/templates/reactjs/App.tsx.tpl +44 -0
  45. package/dist/registry/v6/experiences/2-one-to-one/templates/reactjs/main.tsx.tpl +46 -0
  46. package/dist/registry/v6/experiences/3-tab-based/astro.template.json +93 -0
  47. package/dist/registry/v6/experiences/3-tab-based/nextjs.template.json +90 -0
  48. package/dist/registry/v6/experiences/3-tab-based/react-router.template.json +105 -0
  49. package/dist/registry/v6/experiences/3-tab-based/reactjs.template.json +90 -0
  50. package/dist/registry/v6/experiences/3-tab-based/templates/astro/ChatApp.css.tpl +39 -0
  51. package/dist/registry/v6/experiences/3-tab-based/templates/astro/ChatApp.tsx.tpl +93 -0
  52. package/dist/registry/v6/experiences/3-tab-based/templates/astro/CometChatTabs.css.tpl +43 -0
  53. package/dist/registry/v6/experiences/3-tab-based/templates/astro/CometChatTabs.tsx.tpl +72 -0
  54. package/dist/registry/v6/experiences/3-tab-based/templates/astro/chat.astro.tpl +17 -0
  55. package/dist/registry/v6/experiences/3-tab-based/templates/nextjs/CometChatNoSSR.css.tpl +39 -0
  56. package/dist/registry/v6/experiences/3-tab-based/templates/nextjs/CometChatNoSSR.tsx.tpl +93 -0
  57. package/dist/registry/v6/experiences/3-tab-based/templates/nextjs/CometChatTabs.css.tpl +43 -0
  58. package/dist/registry/v6/experiences/3-tab-based/templates/nextjs/CometChatTabs.tsx.tpl +73 -0
  59. package/dist/registry/v6/experiences/3-tab-based/templates/nextjs/chat-page.tsx.tpl +11 -0
  60. package/dist/registry/v6/experiences/3-tab-based/templates/react-router/CometChat-route.tsx.tpl +21 -0
  61. package/dist/registry/v6/experiences/3-tab-based/templates/react-router/CometChatNoSSR.css.tpl +39 -0
  62. package/dist/registry/v6/experiences/3-tab-based/templates/react-router/CometChatNoSSR.tsx.tpl +94 -0
  63. package/dist/registry/v6/experiences/3-tab-based/templates/react-router/CometChatTabs.css.tpl +43 -0
  64. package/dist/registry/v6/experiences/3-tab-based/templates/react-router/CometChatTabs.tsx.tpl +72 -0
  65. package/dist/registry/v6/experiences/3-tab-based/templates/reactjs/App.css.tpl +7 -0
  66. package/dist/registry/v6/experiences/3-tab-based/templates/reactjs/App.tsx.tpl +62 -0
  67. package/dist/registry/v6/experiences/3-tab-based/templates/reactjs/CometChatTabs.css.tpl +43 -0
  68. package/dist/registry/v6/experiences/3-tab-based/templates/reactjs/CometChatTabs.tsx.tpl +72 -0
  69. package/dist/registry/v6/experiences/3-tab-based/templates/reactjs/main.tsx.tpl +46 -0
  70. package/dist/registry/v6/features/catalog.json +344 -0
  71. package/dist/registry/v6/production/astro/cometchat-token.ts.tpl +86 -0
  72. package/dist/registry/v6/production/astro.template.json +51 -0
  73. package/dist/registry/v6/production/nextjs/route.ts.tpl +79 -0
  74. package/dist/registry/v6/production/nextjs.template.json +50 -0
  75. package/dist/registry/v6/production/react-router/api.cometchat-token.ts.tpl +73 -0
  76. package/dist/registry/v6/production/react-router.template.json +58 -0
  77. package/dist/registry/v6/user-mgmt/astro/cometchat-user.ts.tpl +164 -0
  78. package/dist/registry/v6/user-mgmt/astro.template.json +33 -0
  79. package/dist/registry/v6/user-mgmt/nextjs/route.ts.tpl +212 -0
  80. package/dist/registry/v6/user-mgmt/nextjs.template.json +57 -0
  81. package/dist/registry/v6/user-mgmt/react-router/api.cometchat-user.ts.tpl +176 -0
  82. package/dist/registry/v6/user-mgmt/react-router.template.json +40 -0
  83. package/dist/registry/v6/widget/astro/CometChatWidget.css.tpl +105 -0
  84. package/dist/registry/v6/widget/astro/CometChatWidget.tsx.tpl +88 -0
  85. package/dist/registry/v6/widget/astro.template.json +38 -0
  86. package/dist/registry/v6/widget/nextjs/CometChatWidget.css.tpl +105 -0
  87. package/dist/registry/v6/widget/nextjs/CometChatWidget.tsx.tpl +88 -0
  88. package/dist/registry/v6/widget/nextjs.template.json +40 -0
  89. package/dist/registry/v6/widget/react-router/CometChatWidget.css.tpl +105 -0
  90. package/dist/registry/v6/widget/react-router/CometChatWidget.tsx.tpl +98 -0
  91. package/dist/registry/v6/widget/react-router.template.json +36 -0
  92. package/dist/registry/v6/widget/reactjs/CometChatWidget.css.tpl +105 -0
  93. package/dist/registry/v6/widget/reactjs/CometChatWidget.tsx.tpl +89 -0
  94. package/dist/registry/v6/widget/reactjs.template.json +36 -0
  95. package/package.json +53 -0
@@ -0,0 +1,142 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://cometchat.com/skills/schemas/template.schema.json",
4
+ "title": "CometChat Skills Template",
5
+ "description": "Schema for an experience-template manifest. One file per (framework × experience) combo.",
6
+ "type": "object",
7
+ "required": [
8
+ "version",
9
+ "experience_id",
10
+ "framework",
11
+ "sdk_compatibility",
12
+ "deps",
13
+ "env_vars",
14
+ "files"
15
+ ],
16
+ "additionalProperties": false,
17
+ "properties": {
18
+ "version": {
19
+ "type": "string",
20
+ "description": "Template version. Bumped whenever the template content changes. Used by drift detection.",
21
+ "pattern": "^\\d+\\.\\d+\\.\\d+$"
22
+ },
23
+ "experience_id": {
24
+ "type": "integer",
25
+ "enum": [1, 2, 3],
26
+ "description": "Which experience this template implements."
27
+ },
28
+ "framework": {
29
+ "type": "string",
30
+ "enum": ["reactjs", "nextjs", "react-router", "astro"],
31
+ "description": "Which framework this template targets."
32
+ },
33
+ "sdk_compatibility": {
34
+ "type": "string",
35
+ "description": "Semver range of @cometchat/chat-uikit-react this template is compatible with.",
36
+ "examples": [">=6.0.0 <7.0.0"]
37
+ },
38
+ "default_placement": {
39
+ "type": "string",
40
+ "enum": ["dedicated-route", "embed", "spa-root"],
41
+ "description": "Where the chat UI lands by default. spa-root means it replaces the App.tsx for SPA frameworks."
42
+ },
43
+ "deps": {
44
+ "type": "array",
45
+ "description": "npm packages to install.",
46
+ "items": {
47
+ "type": "object",
48
+ "required": ["name", "version"],
49
+ "additionalProperties": false,
50
+ "properties": {
51
+ "name": { "type": "string" },
52
+ "version": { "type": "string" },
53
+ "dev": { "type": "boolean", "default": false }
54
+ }
55
+ }
56
+ },
57
+ "env_vars": {
58
+ "type": "array",
59
+ "description": "Environment variables that need to be set in .env*. The {{ENV_PREFIX}} placeholder is substituted at apply time based on detected framework.",
60
+ "items": {
61
+ "type": "object",
62
+ "required": ["name", "required"],
63
+ "additionalProperties": false,
64
+ "properties": {
65
+ "name": { "type": "string" },
66
+ "required": { "type": "boolean" },
67
+ "secret": { "type": "boolean", "default": false },
68
+ "description": { "type": "string" }
69
+ }
70
+ }
71
+ },
72
+ "files": {
73
+ "type": "array",
74
+ "description": "Files to create or patch. Order matters — patches apply in array order.",
75
+ "items": {
76
+ "oneOf": [
77
+ {
78
+ "type": "object",
79
+ "required": ["path", "action", "template_ref"],
80
+ "additionalProperties": false,
81
+ "properties": {
82
+ "path": {
83
+ "type": "string",
84
+ "description": "Destination path relative to project root. May contain {{VAR}} placeholders."
85
+ },
86
+ "action": { "const": "create" },
87
+ "template_ref": {
88
+ "type": "string",
89
+ "description": "Path to the template file inside this template's directory."
90
+ },
91
+ "owned": {
92
+ "type": "boolean",
93
+ "default": true,
94
+ "description": "Whether this file is owned by CometChat. Owned files can be cleanly removed by uninstall."
95
+ }
96
+ }
97
+ },
98
+ {
99
+ "type": "object",
100
+ "required": ["path", "action"],
101
+ "additionalProperties": false,
102
+ "properties": {
103
+ "path": { "type": "string" },
104
+ "action": { "const": "patch" },
105
+ "patch_mode": {
106
+ "type": "string",
107
+ "enum": ["prepend", "append", "insert-after", "insert-before", "replace-section"],
108
+ "default": "prepend"
109
+ },
110
+ "patch_content": {
111
+ "type": "string",
112
+ "description": "Inline patch content (for small patches)."
113
+ },
114
+ "patch_ref": {
115
+ "type": "string",
116
+ "description": "Path to a patch file (for larger patches)."
117
+ },
118
+ "anchor": {
119
+ "type": "string",
120
+ "description": "For insert-after / replace-section: the anchor string to find in the target file."
121
+ },
122
+ "skip_if_exists": {
123
+ "type": "string",
124
+ "description": "If this string is already in the file, skip the patch (idempotency)."
125
+ }
126
+ }
127
+ }
128
+ ]
129
+ }
130
+ },
131
+ "verify_rules": {
132
+ "type": "array",
133
+ "description": "Names of AST verification rules that must pass after this template is applied.",
134
+ "items": { "type": "string" }
135
+ },
136
+ "next_steps": {
137
+ "type": "array",
138
+ "description": "Human-readable instructions to show the user after a successful apply.",
139
+ "items": { "type": "string" }
140
+ }
141
+ }
142
+ }
@@ -0,0 +1,89 @@
1
+ {
2
+ "$schema": "../../../schemas/template.schema.json",
3
+ "version": "1.0.0",
4
+ "experience_id": 1,
5
+ "framework": "astro",
6
+ "sdk_compatibility": ">=6.0.0 <7.0.0",
7
+ "default_placement": "dedicated-route",
8
+ "deps": [
9
+ {
10
+ "name": "@cometchat/chat-uikit-react",
11
+ "version": "^6"
12
+ },
13
+ {
14
+ "name": "@cometchat/chat-sdk-javascript",
15
+ "version": "^4"
16
+ },
17
+ {
18
+ "name": "@astrojs/react",
19
+ "version": "^4"
20
+ },
21
+ {
22
+ "name": "react",
23
+ "version": "^18"
24
+ },
25
+ {
26
+ "name": "react-dom",
27
+ "version": "^18"
28
+ }
29
+ ],
30
+ "env_vars": [
31
+ {
32
+ "name": "{{ENV_PREFIX}}COMETCHAT_APP_ID",
33
+ "required": true,
34
+ "description": "CometChat App ID from your dashboard"
35
+ },
36
+ {
37
+ "name": "{{ENV_PREFIX}}COMETCHAT_REGION",
38
+ "required": true,
39
+ "description": "CometChat region (us, eu, in, etc.)"
40
+ },
41
+ {
42
+ "name": "{{ENV_PREFIX}}COMETCHAT_AUTH_KEY",
43
+ "required": true,
44
+ "secret": true,
45
+ "description": "CometChat Auth Key (development only)"
46
+ }
47
+ ],
48
+ "files": [
49
+ {
50
+ "path": "src/cometchat/ChatApp.tsx",
51
+ "action": "create",
52
+ "template_ref": "ChatApp.tsx.tpl",
53
+ "owned": true
54
+ },
55
+ {
56
+ "path": "src/cometchat/ChatApp.css",
57
+ "action": "create",
58
+ "template_ref": "ChatApp.css.tpl",
59
+ "owned": true
60
+ },
61
+ {
62
+ "path": "src/cometchat/CometChatSelector.tsx",
63
+ "action": "create",
64
+ "template_ref": "CometChatSelector.tsx.tpl",
65
+ "owned": true
66
+ },
67
+ {
68
+ "path": "src/pages/chat.astro",
69
+ "action": "create",
70
+ "template_ref": "chat.astro.tpl",
71
+ "owned": true,
72
+ "is_entry": true
73
+ }
74
+ ],
75
+ "verify_rules": [
76
+ "init_before_login",
77
+ "no_user_and_group_same_component",
78
+ "no_auth_key_in_source",
79
+ "render_gated_on_login_resolve",
80
+ "error_ui_visible_on_failure"
81
+ ],
82
+ "next_steps": [
83
+ "If `@astrojs/react` isn't installed yet, run: `npx astro add react`",
84
+ "Run `npm run dev` to start the dev server",
85
+ "Visit http://localhost:4321/chat",
86
+ "Note: css-variables.css is imported inside ChatApp.tsx (not in any global stylesheet) — this is required for Astro client:only islands",
87
+ "When ready for production, run `cometchat apply --production` to set up server-side auth tokens"
88
+ ]
89
+ }
@@ -0,0 +1,83 @@
1
+ {
2
+ "$schema": "../../../schemas/template.schema.json",
3
+ "version": "1.0.0",
4
+ "experience_id": 1,
5
+ "framework": "nextjs-pages",
6
+ "sdk_compatibility": ">=6.0.0 <7.0.0",
7
+ "default_placement": "dedicated-route",
8
+ "deps": [
9
+ {
10
+ "name": "@cometchat/chat-uikit-react",
11
+ "version": "^6"
12
+ },
13
+ {
14
+ "name": "@cometchat/chat-sdk-javascript",
15
+ "version": "^4"
16
+ }
17
+ ],
18
+ "env_vars": [
19
+ {
20
+ "name": "{{ENV_PREFIX}}COMETCHAT_APP_ID",
21
+ "required": true,
22
+ "description": "CometChat App ID from your dashboard"
23
+ },
24
+ {
25
+ "name": "{{ENV_PREFIX}}COMETCHAT_REGION",
26
+ "required": true,
27
+ "description": "CometChat region (us, eu, in, etc.)"
28
+ },
29
+ {
30
+ "name": "{{ENV_PREFIX}}COMETCHAT_AUTH_KEY",
31
+ "required": true,
32
+ "secret": true,
33
+ "description": "CometChat Auth Key (development only)"
34
+ }
35
+ ],
36
+ "files": [
37
+ {
38
+ "path": "src/cometchat/CometChatNoSSR.tsx",
39
+ "action": "create",
40
+ "template_ref": "CometChatNoSSR.tsx.tpl",
41
+ "owned": true
42
+ },
43
+ {
44
+ "path": "src/cometchat/CometChatNoSSR.css",
45
+ "action": "create",
46
+ "template_ref": "CometChatNoSSR.css.tpl",
47
+ "owned": true
48
+ },
49
+ {
50
+ "path": "src/cometchat/CometChatSelector.tsx",
51
+ "action": "create",
52
+ "template_ref": "CometChatSelector.tsx.tpl",
53
+ "owned": true
54
+ },
55
+ {
56
+ "path": "src/pages/chat.tsx",
57
+ "action": "create",
58
+ "template_ref": "chat-page.tsx.tpl",
59
+ "owned": true,
60
+ "is_entry": true
61
+ },
62
+ {
63
+ "path": "src/styles/globals.css",
64
+ "action": "patch",
65
+ "patch_mode": "prepend",
66
+ "patch_content": "@import url(\"@cometchat/chat-uikit-react/css-variables.css\");\n",
67
+ "skip_if_exists": "@cometchat/chat-uikit-react/css-variables.css"
68
+ }
69
+ ],
70
+ "verify_rules": [
71
+ "css_variables_imported_once",
72
+ "init_before_login",
73
+ "no_user_and_group_same_component",
74
+ "no_auth_key_in_source",
75
+ "render_gated_on_login_resolve",
76
+ "error_ui_visible_on_failure"
77
+ ],
78
+ "next_steps": [
79
+ "Run `npm run dev` to start the dev server",
80
+ "Visit http://localhost:3000/chat",
81
+ "When ready for production, run `cometchat apply --production` to set up server-side auth tokens"
82
+ ]
83
+ }
@@ -0,0 +1,83 @@
1
+ {
2
+ "$schema": "../../../schemas/template.schema.json",
3
+ "version": "1.0.0",
4
+ "experience_id": 1,
5
+ "framework": "nextjs",
6
+ "sdk_compatibility": ">=6.0.0 <7.0.0",
7
+ "default_placement": "dedicated-route",
8
+ "deps": [
9
+ {
10
+ "name": "@cometchat/chat-uikit-react",
11
+ "version": "^6"
12
+ },
13
+ {
14
+ "name": "@cometchat/chat-sdk-javascript",
15
+ "version": "^4"
16
+ }
17
+ ],
18
+ "env_vars": [
19
+ {
20
+ "name": "{{ENV_PREFIX}}COMETCHAT_APP_ID",
21
+ "required": true,
22
+ "description": "CometChat App ID from your dashboard"
23
+ },
24
+ {
25
+ "name": "{{ENV_PREFIX}}COMETCHAT_REGION",
26
+ "required": true,
27
+ "description": "CometChat region (us, eu, in, etc.)"
28
+ },
29
+ {
30
+ "name": "{{ENV_PREFIX}}COMETCHAT_AUTH_KEY",
31
+ "required": true,
32
+ "secret": true,
33
+ "description": "CometChat Auth Key (development only)"
34
+ }
35
+ ],
36
+ "files": [
37
+ {
38
+ "path": "src/app/cometchat/CometChatNoSSR.tsx",
39
+ "action": "create",
40
+ "template_ref": "CometChatNoSSR.tsx.tpl",
41
+ "owned": true
42
+ },
43
+ {
44
+ "path": "src/app/cometchat/CometChatNoSSR.css",
45
+ "action": "create",
46
+ "template_ref": "CometChatNoSSR.css.tpl",
47
+ "owned": true
48
+ },
49
+ {
50
+ "path": "src/app/cometchat/CometChatSelector.tsx",
51
+ "action": "create",
52
+ "template_ref": "CometChatSelector.tsx.tpl",
53
+ "owned": true
54
+ },
55
+ {
56
+ "path": "src/app/chat/page.tsx",
57
+ "action": "create",
58
+ "template_ref": "chat-page.tsx.tpl",
59
+ "owned": true,
60
+ "is_entry": true
61
+ },
62
+ {
63
+ "path": "src/app/globals.css",
64
+ "action": "patch",
65
+ "patch_mode": "prepend",
66
+ "patch_content": "@import url(\"@cometchat/chat-uikit-react/css-variables.css\");\n",
67
+ "skip_if_exists": "@cometchat/chat-uikit-react/css-variables.css"
68
+ }
69
+ ],
70
+ "verify_rules": [
71
+ "css_variables_imported_once",
72
+ "init_before_login",
73
+ "no_user_and_group_same_component",
74
+ "no_auth_key_in_source",
75
+ "render_gated_on_login_resolve",
76
+ "error_ui_visible_on_failure"
77
+ ],
78
+ "next_steps": [
79
+ "Run `npm run dev` to start the dev server",
80
+ "Visit http://localhost:3000/chat",
81
+ "When ready for production, run `cometchat apply --production` to set up server-side auth tokens"
82
+ ]
83
+ }
@@ -0,0 +1,102 @@
1
+ {
2
+ "$schema": "../../../schemas/template.schema.json",
3
+ "version": "1.0.0",
4
+ "experience_id": 1,
5
+ "framework": "react-router",
6
+ "sdk_compatibility": ">=6.0.0 <7.0.0",
7
+ "default_placement": "dedicated-route",
8
+ "deps": [
9
+ {
10
+ "name": "@cometchat/chat-uikit-react",
11
+ "version": "^6"
12
+ },
13
+ {
14
+ "name": "@cometchat/chat-sdk-javascript",
15
+ "version": "^4"
16
+ }
17
+ ],
18
+ "env_vars": [
19
+ {
20
+ "name": "{{ENV_PREFIX}}COMETCHAT_APP_ID",
21
+ "required": true,
22
+ "description": "CometChat App ID from your dashboard"
23
+ },
24
+ {
25
+ "name": "{{ENV_PREFIX}}COMETCHAT_REGION",
26
+ "required": true,
27
+ "description": "CometChat region (us, eu, in, etc.)"
28
+ },
29
+ {
30
+ "name": "{{ENV_PREFIX}}COMETCHAT_AUTH_KEY",
31
+ "required": true,
32
+ "secret": true,
33
+ "description": "CometChat Auth Key (development only)"
34
+ }
35
+ ],
36
+ "files": [
37
+ {
38
+ "path": "app/cometchat/CometChatNoSSR.tsx",
39
+ "action": "create",
40
+ "template_ref": "CometChatNoSSR.tsx.tpl",
41
+ "owned": true
42
+ },
43
+ {
44
+ "path": "app/cometchat/CometChatNoSSR.css",
45
+ "action": "create",
46
+ "template_ref": "CometChatNoSSR.css.tpl",
47
+ "owned": true
48
+ },
49
+ {
50
+ "path": "app/cometchat/CometChatSelector.tsx",
51
+ "action": "create",
52
+ "template_ref": "CometChatSelector.tsx.tpl",
53
+ "owned": true
54
+ },
55
+ {
56
+ "path": "app/routes/CometChat.tsx",
57
+ "action": "create",
58
+ "template_ref": "CometChat-route.tsx.tpl",
59
+ "owned": true,
60
+ "is_entry": true
61
+ },
62
+ {
63
+ "path": "app/routes.ts",
64
+ "action": "patch",
65
+ "patch_mode": "replace-section",
66
+ "anchor": "import { type RouteConfig, index }",
67
+ "patch_content": "import { type RouteConfig, index, route } from \"@react-router/dev/routes\";",
68
+ "skip_if_exists": "import { type RouteConfig, index, route }",
69
+ "embed_skip": true
70
+ },
71
+ {
72
+ "path": "app/routes.ts",
73
+ "action": "patch",
74
+ "patch_mode": "insert-before",
75
+ "anchor": "] satisfies RouteConfig",
76
+ "patch_content": " route(\"chat\", \"routes/CometChat.tsx\"),\n",
77
+ "skip_if_exists": "routes/CometChat.tsx",
78
+ "embed_skip": true
79
+ },
80
+ {
81
+ "path": "app/app.css",
82
+ "action": "patch",
83
+ "patch_mode": "prepend",
84
+ "patch_content": "@import url(\"@cometchat/chat-uikit-react/css-variables.css\");\n",
85
+ "skip_if_exists": "@cometchat/chat-uikit-react/css-variables.css"
86
+ }
87
+ ],
88
+ "verify_rules": [
89
+ "css_variables_imported_once",
90
+ "init_before_login",
91
+ "no_user_and_group_same_component",
92
+ "no_auth_key_in_source",
93
+ "render_gated_on_login_resolve",
94
+ "error_ui_visible_on_failure"
95
+ ],
96
+ "next_steps": [
97
+ "Add the chat route to app/routes.ts: route(\"chat\", \"routes/CometChat.tsx\")",
98
+ "Run `npm run dev` to start the dev server",
99
+ "Visit http://localhost:5173/chat",
100
+ "When ready for production, run `cometchat apply --production` to set up server-side auth tokens"
101
+ ]
102
+ }
@@ -0,0 +1,86 @@
1
+ {
2
+ "$schema": "../../../schemas/template.schema.json",
3
+ "version": "1.0.0",
4
+ "experience_id": 1,
5
+ "framework": "reactjs",
6
+ "sdk_compatibility": ">=6.0.0 <7.0.0",
7
+ "default_placement": "spa-root",
8
+ "deps": [
9
+ {
10
+ "name": "@cometchat/chat-uikit-react",
11
+ "version": "^6"
12
+ },
13
+ {
14
+ "name": "@cometchat/chat-sdk-javascript",
15
+ "version": "^4"
16
+ }
17
+ ],
18
+ "env_vars": [
19
+ {
20
+ "name": "{{ENV_PREFIX}}COMETCHAT_APP_ID",
21
+ "required": true,
22
+ "description": "CometChat App ID from your dashboard"
23
+ },
24
+ {
25
+ "name": "{{ENV_PREFIX}}COMETCHAT_REGION",
26
+ "required": true,
27
+ "description": "CometChat region (us, eu, in, etc.)"
28
+ },
29
+ {
30
+ "name": "{{ENV_PREFIX}}COMETCHAT_AUTH_KEY",
31
+ "required": true,
32
+ "secret": true,
33
+ "description": "CometChat Auth Key (development only — use auth tokens in production)"
34
+ }
35
+ ],
36
+ "files": [
37
+ {
38
+ "path": "src/main.tsx",
39
+ "action": "create",
40
+ "template_ref": "main.tsx.tpl",
41
+ "owned": true,
42
+ "embed_skip": true
43
+ },
44
+ {
45
+ "path": "src/App.tsx",
46
+ "action": "create",
47
+ "template_ref": "App.tsx.tpl",
48
+ "owned": true,
49
+ "is_entry": true
50
+ },
51
+ {
52
+ "path": "src/App.css",
53
+ "action": "create",
54
+ "template_ref": "App.css.tpl",
55
+ "owned": true,
56
+ "move_with_entry": true
57
+ },
58
+ {
59
+ "path": "src/cometchat/CometChatSelector.tsx",
60
+ "action": "create",
61
+ "template_ref": "CometChatSelector.tsx.tpl",
62
+ "owned": true
63
+ },
64
+ {
65
+ "path": "src/index.css",
66
+ "action": "patch",
67
+ "patch_mode": "prepend",
68
+ "patch_content": "@import url(\"@cometchat/chat-uikit-react/css-variables.css\");\n",
69
+ "skip_if_exists": "@cometchat/chat-uikit-react/css-variables.css"
70
+ }
71
+ ],
72
+ "verify_rules": [
73
+ "css_variables_imported_once",
74
+ "init_before_login",
75
+ "no_user_and_group_same_component",
76
+ "no_auth_key_in_source",
77
+ "render_gated_on_login_resolve",
78
+ "error_ui_visible_on_failure"
79
+ ],
80
+ "next_steps": [
81
+ "Run `npm run dev` to start the dev server",
82
+ "Visit http://localhost:5173",
83
+ "Click a conversation in the left panel to open it",
84
+ "When ready for production, run `cometchat apply --production` to set up server-side auth tokens"
85
+ ]
86
+ }
@@ -0,0 +1,39 @@
1
+ .conversations-with-messages {
2
+ display: flex;
3
+ height: 100vh;
4
+ width: 100%;
5
+ }
6
+
7
+ .conversations-wrapper {
8
+ height: 100%;
9
+ width: 480px;
10
+ overflow: hidden;
11
+ display: flex;
12
+ flex-direction: column;
13
+ }
14
+
15
+ .conversations-wrapper > .cometchat {
16
+ overflow: hidden;
17
+ }
18
+
19
+ .messages-wrapper {
20
+ width: calc(100% - 480px);
21
+ height: 100%;
22
+ display: flex;
23
+ flex-direction: column;
24
+ }
25
+
26
+ .empty-conversation {
27
+ height: 100%;
28
+ width: 100%;
29
+ display: flex;
30
+ justify-content: center;
31
+ align-items: center;
32
+ background: white;
33
+ color: var(--cometchat-text-color-secondary, #727272);
34
+ font: var(--cometchat-font-body-regular, 400 14px Roboto);
35
+ }
36
+
37
+ .cometchat .cometchat-message-composer {
38
+ border-radius: 0;
39
+ }