File tree Expand file tree Collapse file tree 2 files changed +39
-4
lines changed Expand file tree Collapse file tree 2 files changed +39
-4
lines changed Original file line number Diff line number Diff line change 11# vanus.js
22Help 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 | |
Original file line number Diff line number Diff line change 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' ) ;
You can’t perform that action at this time.
0 commit comments