@innovastudio/contentbox 1.5.81 → 1.5.83

Sign up to get free protection for your applications and to get access to all the features.
package/readme.txt CHANGED
@@ -31,18 +31,35 @@ or run the example project:
31
31
 
32
32
  A browser window will open with the ContentBox.js example running.
33
33
 
34
- - The ContentBox initiation can be found in 'src/index.js'.
34
+ - The ContentBox initialization can be found in 'src/index.js'.
35
35
  - The Node.js server code is in 'server.js'.
36
36
 
37
37
  NOTE:
38
38
 
39
+ - The AI Assistant is an optional feature that you can enable or disable.
40
+ Please refer to the AI Assistant documentation:
41
+
42
+ https://demo.innovastudio.com/docs/AI-Assistant.pdf
43
+
39
44
  - To use the AI Assistant:
40
- 1. Obtain the OpenAI API key from https://openai.com
45
+ 1. Obtain the OpenAI API key from https://openai.com.
41
46
  2. Update the .env file with your API key.
42
47
 
43
- Or if you're using PHP, update the 'sendcommand.php' file with your API key:
48
+ Alternatively, if you're using PHP, update the 'api/config.php' file with your API key:
49
+
50
+ $OPENAI_API_KEY = 'YOUR_API_KEY';
44
51
 
45
- define('OPENAI_API_KEY', 'YOUR_API_KEY_HERE');
52
+ 3. Initialization
53
+
54
+ const builder = new ContentBox({
55
+ sendCommandUrl: '/sendcommand',
56
+ });
57
+
58
+ If you're using PHP:
59
+
60
+ const builder = new ContentBox({
61
+ sendCommandUrl: '/sendcommand',
62
+ });
46
63
 
47
64
  - For speech recognition (if dictation is enabled), the browser's built-in
48
65
  speech recognition is used. However, certain browsers may not support this feature.
@@ -50,31 +67,60 @@ NOTE:
50
67
  Obtain the Deepgram API key from https://deepgram.com.
51
68
  An example of using Deepgram is provided in the example project.
52
69
  Obtain the Deepgram API key and update the .env file with your API key.
53
- Then enable the 'speechTranscribeUrl' parameter in the ContentBox initiation (src/index.js).
70
+ Then enable the 'speechTranscribeUrl' parameter in the ContentBox initialization (src/index.js).
54
71
 
55
- - The AI Assistant is an optional feature that you can enable or disable.
56
- Please refer to the AI Assistant documentation.
72
+ - To use the AI image generation:
73
+ 1. Obtain the OpenAI API key from https://getimg.ai/tools/api.
74
+ 2. Update the .env file with your API key.
57
75
 
58
- - AI Assistant documentation
76
+ Alternatively, if you're using PHP, update the 'api/config.php' file with your API key:
59
77
 
60
- https://demo.innovastudio.com/docs/AI-Assistant.pdf
78
+ $GETIMG_API_KEY = 'YOUR_API_KEY';
61
79
 
80
+ 3. Initialization
62
81
 
63
- ______________________
82
+ const builder = new ContentBox({
83
+ textToImageUrl: '/texttoimage',
84
+ upscaleImageUrl: '/upscaleimage',
85
+ imageAutoUpscale: true,
86
+ });
87
+
88
+ If you're using PHP:
89
+
90
+ const builder = new ContentBox({
91
+ textToImageUrl: 'api/texttoimage.php',
92
+ upscaleImageUrl: 'api/upscaleimage.php',
93
+ imageAutoUpscale: true,
94
+ });
95
+
96
+ - Please add your own security to the API endpoints (public/api/)!
97
+
98
+ - You can try a full working example by running the example project (please refer to the previous instructions).
64
99
 
65
100
 
101
+ ______________________
102
+ SOURCE CODE PACKAGE
103
+
66
104
  If you have the ContentBox source code:
67
105
 
68
106
  - The source code is located in the 'src/contentbox/' folder.
69
107
  When you run the project, you can try modifying the source code, and
70
108
  the changes will be applied, and the browser will refresh automatically.
71
109
 
72
- - When finished, to build the JS code that you can use in production, run:
110
+ - When finished, to build the JavaScript code for production use, update the package.json file:
111
+
112
+ {
113
+ "name": "@innovastudio/contentbox",
114
+ "type": "module",
115
+
116
+ }
117
+
118
+ Then, run:
73
119
 
74
120
  > npm run build
75
121
 
76
122
  The minified JS will be generated in the folder: 'public/contentbuilder/contentbuilder.min.js'.
77
- You can test it by opening, for example, 'public/example.html'.
123
+ You can test it by opening: 'public/example.html'.
78
124
  If you're using Visual Studio Code, right-click on the 'example.html' file and select "Open with Live Server".
79
125
 
80
126
  - To build CSS from SCSS files, run: