Skip to content

Commit 7215f6c

Browse files
authored
Merge pull request #4 from vanus-labs/develop
feat: add docs to quick start
2 parents c3c8f9b + 94f75dc commit 7215f6c

File tree

2 files changed

+39
-4
lines changed

2 files changed

+39
-4
lines changed

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,37 @@
11
# vanus.js
22
Help users quickly integrate Vanus AI
3+
4+
# Quick Start
5+
There are 2 ways to quick start as follow.
6+
7+
## 1.Use Javascript
8+
```html
9+
<script src="https://vanus.ai/js/ai.embed.js"></script>
10+
<script>
11+
const config = {
12+
id: 'xxxx',
13+
lang: 'en',
14+
};
15+
setVanusConfig(config);
16+
</script>
17+
```
18+
19+
## Parameters
20+
| Name | Description | Required | Optional |
21+
| :-------- | :----- | :----- | :----: |
22+
| id | Vanus AI Application ID | True | |
23+
| lang | Default language | False | `en`,`cn` |
24+
25+
26+
## 2.Use Iframe Tag
27+
```html
28+
// For Chinese Language
29+
<iframe src="https://ai.vanus.cn/app/embed?id={id}"></iframe>
30+
// For English Language
31+
<iframe src="https://ai.vanus.ai/app/embed?id={id}"></iframe>
32+
```
33+
34+
## Parameters
35+
| Name | Description | Required | Optional |
36+
| :-------- | :----- | :----- | :----: |
37+
| id | Vanus AI Application ID | True | |

index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
(function () {
2-
window.addEventListener('DOMContentLoaded', init);
3-
})();
4-
5-
function init() {
62
window.vanusConfig = {
73
id: null,
84
lang: 'en',
@@ -40,6 +36,10 @@ function init() {
4036
},
4137
};
4238

39+
window.addEventListener('DOMContentLoaded', init);
40+
})();
41+
42+
function init() {
4343
const flag = checkVanusConfig();
4444
if (!flag) {
4545
console.error('Must set correct config');

0 commit comments

Comments
 (0)