Skip to content

Commit

Permalink
Update env guide, change type package
Browse files Browse the repository at this point in the history
  • Loading branch information
vietredweb committed Nov 11, 2022
1 parent a9314ee commit 3db9b35
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .env.dist
Original file line number Diff line number Diff line change
@@ -1 +1 @@
REACT_APP_ENDPOINT_ANALYTICS_URL=https://example.com
ENDPOINT_ANALYTICS_URL=https://example.com
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@
`npm run build`

# Usage in SSR site:
##### setup package:
`git clone [email protected]:aesirx/analytics.git`

##### create `.env` file
```
ENDPOINT_ANALYTICS_URL=https://api.dashboard.aesirx.io
```
##### build the tracker file:
```
git clone [email protected]:aesirx/analytics.git
npm install
npm run build
```
Expand All @@ -17,7 +23,10 @@ npm run build
# Usage in ReactJS

`npm install aesirx_analytics git+ssh://[email protected]:aesirx/analytics.git#master --save-dev`

##### add environment variable (`.env`)
```
REACT_APP_ENDPOINT_ANALYTICS_URL=https://api.dashboard.aesirx.io
```
##### with react-router-dom v5:
###### create AnalyticsContainer component:
```
Expand All @@ -36,7 +45,10 @@ export default AnalyticsContainer;
# Usage in NextJS

`npm install aesirx_analytics git+ssh://[email protected]:aesirx/analytics.git#master --save-dev`

##### add environment variable (`.env`)
```
NEXT_PUBLIC_ENDPOINT_ANALYTICS_URL=https://api.dashboard.aesirx.io
```
##### with next/router:
###### using in app.js:
```
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"main": "build/lib/cjs/index.js",
"module": "build/lib/esm/index.js",
"source": "src/index.js",
"type": "module",
"dependencies": {
"@babel/cli": "^7.19.3",
"@babel/core": "^7.19.6",
Expand Down

0 comments on commit 3db9b35

Please sign in to comment.