Browse Source
Merge pull request #437 from Budibase/posthog-analytics
posthog analytics
pull/439/head
Martin McKeaveney
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with
12 additions and
3 deletions
-
.github/workflows/budibase_ci.yml
-
packages/builder/package.json
-
packages/builder/rollup.config.js
-
packages/builder/src/builderStore/index.js
-
packages/builder/src/components/settings/tabs/APIKeys.svelte
|
|
|
@ -29,6 +29,9 @@ jobs: |
|
|
|
- run: yarn lint |
|
|
|
- run: yarn bootstrap |
|
|
|
- run: yarn build |
|
|
|
env: |
|
|
|
POSTHOG_TOKEN: ${{ secrets.POSTHOG_TOKEN }} |
|
|
|
POSTHOG_URL: ${{ secrets.POSTHOG_URL }} |
|
|
|
- run: yarn test |
|
|
|
env: |
|
|
|
CI: true |
|
|
|
|
|
|
|
@ -64,9 +64,9 @@ |
|
|
|
"feather-icons": "^4.21.0", |
|
|
|
"flatpickr": "^4.5.7", |
|
|
|
"lodash": "^4.17.13", |
|
|
|
"logrocket": "^1.0.6", |
|
|
|
"lunr": "^2.3.5", |
|
|
|
"mustache": "^4.0.1", |
|
|
|
"posthog-js": "^1.3.1", |
|
|
|
"safe-buffer": "^5.1.2", |
|
|
|
"shortid": "^2.2.8", |
|
|
|
"string_decoder": "^1.2.0", |
|
|
|
|
|
|
|
@ -180,6 +180,8 @@ export default { |
|
|
|
"process.env.NODE_ENV": JSON.stringify( |
|
|
|
production ? "production" : "development" |
|
|
|
), |
|
|
|
"process.env.POSTHOG_TOKEN": JSON.stringify(process.env.POSTHOG_TOKEN), |
|
|
|
"process.env.POSTHOG_URL": JSON.stringify(process.env.POSTHOG_URL), |
|
|
|
}), |
|
|
|
|
|
|
|
svelte({ |
|
|
|
|
|
|
|
@ -1,7 +1,7 @@ |
|
|
|
import { getStore } from "./store" |
|
|
|
import { getBackendUiStore } from "./store/backend" |
|
|
|
import { getWorkflowStore } from "./store/workflow/" |
|
|
|
import LogRocket from "logrocket" |
|
|
|
import posthog from "posthog-js" |
|
|
|
|
|
|
|
export const store = getStore() |
|
|
|
export const backendUiStore = getBackendUiStore() |
|
|
|
@ -10,7 +10,9 @@ export const workflowStore = getWorkflowStore() |
|
|
|
export const initialise = async () => { |
|
|
|
try { |
|
|
|
if (process.env.NODE_ENV === "production") { |
|
|
|
LogRocket.init("knlald/budibase") |
|
|
|
posthog.init(process.env.POSTHOG_TOKEN, { |
|
|
|
api_host: process.env.POSTHOG_URL, |
|
|
|
}) |
|
|
|
} |
|
|
|
} catch (err) { |
|
|
|
console.log(err) |
|
|
|
|
|
|
|
@ -2,12 +2,14 @@ |
|
|
|
import { Input, Button } from "@budibase/bbui" |
|
|
|
import { store } from "builderStore" |
|
|
|
import api from "builderStore/api" |
|
|
|
import posthog from "posthog-js" |
|
|
|
|
|
|
|
let keys = { budibase: "", sendGrid: "" } |
|
|
|
|
|
|
|
async function updateKey([key, value]) { |
|
|
|
const response = await api.put(`/api/keys/${key}`, { value }) |
|
|
|
const res = await response.json() |
|
|
|
if (key === "budibase") posthog.identify(value) |
|
|
|
keys = { ...keys, ...res } |
|
|
|
} |
|
|
|
|
|
|
|
|