Skip to content

[feat] Integrate PostHog plugin #8911

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 24 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
03f6a43
feat(plugin-posthog): initial setup of PostHog plugin
samuelmbabhazi Apr 11, 2025
aa03d43
feat(posthog): add interfaces for PostHog module configuration
samuelmbabhazi Apr 11, 2025
2e72a9d
feat(posthog): add constant for injection token
samuelmbabhazi Apr 11, 2025
2c5370b
feat(posthog): implement PosthogService with track, identify and shut…
samuelmbabhazi Apr 11, 2025
1a0c7b6
feat(posthog): implement core module with support for sync and async …
samuelmbabhazi Apr 11, 2025
6a39e81
feat(posthog): create main module with forRoot and forRootAsync
samuelmbabhazi Apr 11, 2025
b4295d7
chore(posthog):install latest posthog-node
samuelmbabhazi Apr 11, 2025
8342d09
feat(posthog): update PostHog interfaces to match official client opt…
samuelmbabhazi Apr 12, 2025
e1aee9b
feat(posthog): enhance PostHog service with feature flag support and …
samuelmbabhazi Apr 12, 2025
1577b50
feat(posthog): update PostHog interfaces to match official client opt…
samuelmbabhazi Apr 12, 2025
c64121a
feat(middleware): add PosthogRequestMiddleware for capturing request …
samuelmbabhazi Apr 13, 2025
ced2ee0
feat(middleware): enhance PosthogTraceMiddleware with performance met…
samuelmbabhazi Apr 13, 2025
c037973
feat(interceptor): implement PosthogErrorInterceptor for error tracking
samuelmbabhazi Apr 13, 2025
e516044
feat(plugin): create base PosthogPlugin structure
samuelmbabhazi Apr 13, 2025
0339d15
feat(interceptor): implement PosthogCustomInterceptor
samuelmbabhazi Apr 13, 2025
fa03ef1
feat(config):Add config posthog
samuelmbabhazi Apr 13, 2025
f573c2b
add plugin
samuelmbabhazi Apr 13, 2025
c97f224
feat(posthog): Refactor service logic && update config
samuelmbabhazi Apr 14, 2025
63fa490
Remove unnecessary changes
samuelmbabhazi Apr 14, 2025
a4891b6
feat(posthog):Refactor and reorganize the plugin codebase for better …
samuelmbabhazi Apr 15, 2025
5c2b322
fix: deepscan
samuelmbabhazi Apr 15, 2025
bc54510
feadback integration
samuelmbabhazi Apr 16, 2025
66f060d
suggestion integration
samuelmbabhazi Apr 16, 2025
cb03689
remove unecessary changes
samuelmbabhazi Apr 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ services:
SENTRY_HTTP_TRACING_ENABLED: '${SENTRY_HTTP_TRACING_ENABLED:-}'
SENTRY_POSTGRES_TRACKING_ENABLED: '${SENTRY_POSTGRES_TRACKING_ENABLED:-}'
SENTRY_PROFILING_ENABLED: '${SENTRY_PROFILING_ENABLED:-}'
POSTHOG_KEY: '${POSTHOG_KEY:-}'
POSTHOG_HOST: '${POSTHOG_HOST:-}'
POSTHOG_ENABLED: '${POSTHOG_ENABLED:-}'
POSTHOG_FLUSH_INTERVAL: '${POSTHOG_FLUSH_INTERVAL:-}'
AWS_ACCESS_KEY_ID: '${AWS_ACCESS_KEY_ID:-}'
AWS_SECRET_ACCESS_KEY: '${AWS_SECRET_ACCESS_KEY:-}'
AWS_REGION: '${AWS_REGION:-}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ services:
SENTRY_HTTP_TRACING_ENABLED: '${SENTRY_HTTP_TRACING_ENABLED}'
SENTRY_POSTGRES_TRACKING_ENABLED: '${SENTRY_POSTGRES_TRACKING_ENABLED}'
SENTRY_PROFILING_ENABLED: '${SENTRY_PROFILING_ENABLED}'
POSTHOG_KEY: '${POSTHOG_KEY}'
POSTHOG_HOST: '${POSTHOG_HOST}'
POSTHOG_ENABLED: '${POSTHOG_ENABLED}'
POSTHOG_FLUSH_INTERVAL: '${POSTHOG_FLUSH_INTERVAL}'
AWS_ACCESS_KEY_ID: '${AWS_ACCESS_KEY_ID}'
AWS_SECRET_ACCESS_KEY: '${AWS_SECRET_ACCESS_KEY}'
AWS_REGION: '${AWS_REGION}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ services:
SENTRY_HTTP_TRACING_ENABLED: '${SENTRY_HTTP_TRACING_ENABLED}'
SENTRY_POSTGRES_TRACKING_ENABLED: '${SENTRY_POSTGRES_TRACKING_ENABLED}'
SENTRY_PROFILING_ENABLED: '${SENTRY_PROFILING_ENABLED}'
POSTHOG_KEY: '${POSTHOG_KEY}'
POSTHOG_HOST: '${POSTHOG_HOST}'
POSTHOG_ENABLED: '${POSTHOG_ENABLED}'
POSTHOG_FLUSH_INTERVAL: '${POSTHOG_FLUSH_INTERVAL}'
AWS_ACCESS_KEY_ID: '${AWS_ACCESS_KEY_ID}'
AWS_SECRET_ACCESS_KEY: '${AWS_SECRET_ACCESS_KEY}'
AWS_REGION: '${AWS_REGION}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ services:
SENTRY_HTTP_TRACING_ENABLED: '${SENTRY_HTTP_TRACING_ENABLED:-}'
SENTRY_POSTGRES_TRACKING_ENABLED: '${SENTRY_POSTGRES_TRACKING_ENABLED:-}'
SENTRY_PROFILING_ENABLED: '${SENTRY_PROFILING_ENABLED:-}'
POSTHOG_KEY: '${POSTHOG_KEY:-}'
POSTHOG_HOST: '${POSTHOG_HOST:-}'
POSTHOG_ENABLED: '${POSTHOG_ENABLED:-}'
POSTHOG_FLUSH_INTERVAL: '${POSTHOG_FLUSH_INTERVAL:-}'
AWS_ACCESS_KEY_ID: '${AWS_ACCESS_KEY_ID:-}'
AWS_SECRET_ACCESS_KEY: '${AWS_SECRET_ACCESS_KEY:-}'
AWS_REGION: '${AWS_REGION:-}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ services:
SENTRY_HTTP_TRACING_ENABLED: '${SENTRY_HTTP_TRACING_ENABLED}'
SENTRY_POSTGRES_TRACKING_ENABLED: '${SENTRY_POSTGRES_TRACKING_ENABLED}'
SENTRY_PROFILING_ENABLED: '${SENTRY_PROFILING_ENABLED}'
POSTHOG_KEY: '${POSTHOG_KEY}'
POSTHOG_HOST: '${POSTHOG_HOST}'
POSTHOG_ENABLED: '${POSTHOG_ENABLED}'
POSTHOG_FLUSH_INTERVAL: '${POSTHOG_FLUSH_INTERVAL}'
AWS_ACCESS_KEY_ID: '${AWS_ACCESS_KEY_ID}'
AWS_SECRET_ACCESS_KEY: '${AWS_SECRET_ACCESS_KEY}'
AWS_REGION: '${AWS_REGION}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ services:
SENTRY_HTTP_TRACING_ENABLED: '${SENTRY_HTTP_TRACING_ENABLED}'
SENTRY_POSTGRES_TRACKING_ENABLED: '${SENTRY_POSTGRES_TRACKING_ENABLED}'
SENTRY_PROFILING_ENABLED: '${SENTRY_PROFILING_ENABLED}'
POSTHOG_KEY: '${POSTHOG_KEY}'
POSTHOG_HOST: '${POSTHOG_HOST}'
POSTHOG_ENABLED: '${POSTHOG_ENABLED}'
POSTHOG_FLUSH_INTERVAL: '${POSTHOG_FLUSH_INTERVAL}'
AWS_ACCESS_KEY_ID: '${AWS_ACCESS_KEY_ID}'
AWS_SECRET_ACCESS_KEY: '${AWS_SECRET_ACCESS_KEY}'
AWS_REGION: '${AWS_REGION}'
Expand Down
6 changes: 6 additions & 0 deletions .env.compose
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,12 @@
SENTRY_PROFILING_ENABLED=false
SENTRY_TRACES_SAMPLE_RATE=0.1

# PostHog Configuration
POSTHOG_KEY=

Check warning on line 254 in .env.compose

View workflow job for this annotation

GitHub Actions / Cspell

Unknown word (POSTHOG)
POSTHOG_HOST=https://app.posthog.com

Check warning on line 255 in .env.compose

View workflow job for this annotation

GitHub Actions / Cspell

Unknown word (POSTHOG)
POSTHOG_ENABLED=true

Check warning on line 256 in .env.compose

View workflow job for this annotation

GitHub Actions / Cspell

Unknown word (POSTHOG)
POSTHOG_FLUSH_INTERVAL=10000

Check warning on line 257 in .env.compose

View workflow job for this annotation

GitHub Actions / Cspell

Unknown word (POSTHOG)

# Default Currency
DEFAULT_CURRENCY=USD

Expand Down
8 changes: 8 additions & 0 deletions .env.demo.compose
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,14 @@
SENTRY_PROFILING_ENABLED=false
SENTRY_TRACES_SAMPLE_RATE=0.1


# PostHog Configuration
POSTHOG_KEY=

Check warning on line 262 in .env.demo.compose

View workflow job for this annotation

GitHub Actions / Cspell

Unknown word (POSTHOG)
POSTHOG_HOST=https://app.posthog.com

Check warning on line 263 in .env.demo.compose

View workflow job for this annotation

GitHub Actions / Cspell

Unknown word (POSTHOG)
POSTHOG_ENABLED=true

Check warning on line 264 in .env.demo.compose

View workflow job for this annotation

GitHub Actions / Cspell

Unknown word (POSTHOG)
POSTHOG_FLUSH_INTERVAL=10000

Check warning on line 265 in .env.demo.compose

View workflow job for this annotation

GitHub Actions / Cspell

Unknown word (POSTHOG)


# Default Currency
DEFAULT_CURRENCY=USD

Expand Down
6 changes: 6 additions & 0 deletions .env.docker
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,12 @@
SENTRY_PROFILING_ENABLED=false
SENTRY_TRACES_SAMPLE_RATE=0.1

# PostHog Configuration
POSTHOG_KEY=

Check warning on line 241 in .env.docker

View workflow job for this annotation

GitHub Actions / Cspell

Unknown word (POSTHOG)
POSTHOG_HOST=https://app.posthog.com

Check warning on line 242 in .env.docker

View workflow job for this annotation

GitHub Actions / Cspell

Unknown word (POSTHOG)
POSTHOG_ENABLED=true
POSTHOG_FLUSH_INTERVAL=10000

# Default Currency
DEFAULT_CURRENCY=USD

Expand Down
6 changes: 6 additions & 0 deletions .env.local
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,12 @@ SENTRY_PROFILING_ENABLED=false
SENTRY_TRACES_SAMPLE_RATE=0.01
SENTRY_PROFILE_SAMPLE_RATE=0.01

# PostHog Configuration
POSTHOG_KEY=phc_w5PscE14j8Gthj1LqEoYXdr7srlwvfRRUZF2aLxbazC
POSTHOG_HOST=https://us.i.posthog.com
POSTHOG_ENABLED=false
POSTHOG_FLUSH_INTERVAL=10000

# Default Currency
DEFAULT_CURRENCY=USD

Expand Down
6 changes: 6 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,12 @@ SENTRY_PROFILING_ENABLED=
SENTRY_TRACES_SAMPLE_RATE=
SENTRY_PROFILE_SAMPLE_RATE=

# PostHog Configuration
POSTHOG_KEY=
POSTHOG_HOST=
POSTHOG_ENABLED=
POSTHOG_FLUSH_INTERVAL=

# Default Currency
DEFAULT_CURRENCY=USD

Expand Down
1 change: 1 addition & 0 deletions apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"@gauzy/plugin-knowledge-base": "^0.1.0",
"@gauzy/plugin-product-reviews": "^0.1.0",
"@gauzy/plugin-sentry": "^0.1.0",
"@gauzy/plugin-posthog": "^0.1.0",
"@gauzy/plugin-videos": "^0.1.0",
"@gauzy/plugin-registry": "^0.1.0",
"dotenv": "^16.0.3",
Expand Down
30 changes: 28 additions & 2 deletions apps/api/src/plugin-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ import {
dbKnexConnectionConfig
} from '@gauzy/config';
import { SentryService } from '@gauzy/plugin-sentry';
import { PosthogService } from '@gauzy/plugin-posthog';
import { PosthogAnalytics as PosthogPlugin } from './posthog';
import { SentryTracing as SentryPlugin } from './sentry';
import { version } from './../version';
import { plugins } from './plugins';

const { sentry } = environment;
const { sentry, posthog } = environment;

console.log(chalk.magenta(`API Version %s`), version);
console.log('Plugin Config -> __dirname: ' + __dirname);
Expand Down Expand Up @@ -90,6 +92,30 @@ export const pluginConfig: ApplicationPluginConfig = {
assetPath: assetPath,
assetPublicPath: assetPublicPath
},
...(sentry?.dsn ? { logger: new SentryService(SentryPlugin.options) } : {}),
logger: (() => {
const loggers = [];

if (sentry?.dsn) {
loggers.push(new SentryService(SentryPlugin.options));
}
if (posthog?.posthogEnabled && posthog?.posthogKey) {
loggers.push(new PosthogService(PosthogPlugin.options));
}

// Combine both, or return undefined if no logger is configured
if (loggers.length === 0) {
return undefined;
} else if (loggers.length === 1) {
return loggers[0];
} else {
return {
log: (...args) => loggers.forEach((logger) => logger.log?.(...args)),
error: (...args) => loggers.forEach((logger) => logger.error?.(...args)),
warn: (...args) => loggers.forEach((logger) => logger.warn?.(...args)),
debug: (...args) => loggers.forEach((logger) => logger.debug?.(...args)),
verbose: (...args) => loggers.forEach((logger) => logger.verbose?.(...args))
};
}
})(),
plugins
};
7 changes: 6 additions & 1 deletion apps/api/src/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,20 @@ import { VideosPlugin } from '@gauzy/plugin-videos';
import { RegistryPlugin } from '@gauzy/plugin-registry';

import { SentryTracing as SentryPlugin } from './sentry';
import { PosthogAnalytics as PosthogPlugin } from './posthog';

const { jitsu, sentry } = environment;
const { jitsu, sentry, posthog } = environment;

/**
* An array of plugins to be included or used in the codebase.
*/
export const plugins = [
// Includes the SentryPlugin based on the presence of Sentry configuration.
...(sentry && sentry.dsn ? [SentryPlugin] : []),

// Includes the PostHogPlugin based on the presence of PostHog configuration.
...(posthog?.posthogEnabled && posthog?.posthogKey ? [PosthogPlugin] : []),

// Initializes the Jitsu Analytics Plugin by providing a configuration object.
JitsuAnalyticsPlugin.init({
config: {
Expand Down
31 changes: 31 additions & 0 deletions apps/api/src/posthog.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { environment } from '@gauzy/config';
import { PosthogPlugin } from '@gauzy/plugin-posthog';

/**
* Initializes and configures the PostHog plugin for analytics and performance tracking.
*
* This function checks if PostHog tracking is enabled in the environment configuration.
* If enabled, it initializes the PostHog plugin with the specified settings.
* Otherwise, it logs a message indicating that PostHog was not initialized.
*
* @returns {typeof PosthogPlugin | null} The configured PostHog instance, or null if not initialized.
*/
export function initializePosthog(): typeof PosthogPlugin | null {
if (!environment.posthog?.posthogEnabled || !environment.posthog?.posthogKey) {
console.log('PostHog not initialized: Tracking is disabled or API key is missing');
return null;
}

// Configure PostHog
return PosthogPlugin.init({
apiKey: environment.posthog.posthogKey,
apiHost: environment.posthog.posthogHost || 'https://app.posthog.com',
enableErrorTracking: true,
flushInterval: environment.posthog.posthogFlushInterval || 10000,
flushAt: 20,
autocapture: true,
mock: false
});
}

export const PosthogAnalytics = initializePosthog();
4 changes: 4 additions & 0 deletions docker-compose.build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ services:
SENTRY_HTTP_TRACING_ENABLED: ${SENTRY_HTTP_TRACING_ENABLED:-}
SENTRY_POSTGRES_TRACKING_ENABLED: ${SENTRY_POSTGRES_TRACKING_ENABLED:-}
SENTRY_PROFILING_ENABLED: ${SENTRY_PROFILING_ENABLED:-}
POSTHOG_KEY: ${POSTHOG_KEY:-}
POSTHOG_HOST: ${POSTHOG_HOST:-}
POSTHOG_ENABLED: ${POSTHOG_ENABLED:-}
POSTHOG_FLUSH_INTERVAL: ${POSTHOG_FLUSH_INTERVAL:-}
JITSU_SERVER_URL: ${JITSU_SERVER_URL:-}
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: ${OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:-}
OTEL_EXPORTER_OTLP_HEADERS: ${OTEL_EXPORTER_OTLP_HEADERS:-}
Expand Down
4 changes: 4 additions & 0 deletions docker-compose.demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ services:
SENTRY_HTTP_TRACING_ENABLED: ${SENTRY_HTTP_TRACING_ENABLED:-}
SENTRY_POSTGRES_TRACKING_ENABLED: ${SENTRY_POSTGRES_TRACKING_ENABLED:-}
SENTRY_PROFILING_ENABLED: ${SENTRY_PROFILING_ENABLED:-}
POSTHOG_KEY: ${POSTHOG_KEY:-}
POSTHOG_HOST: ${POSTHOG_HOST:-}
POSTHOG_ENABLED: ${POSTHOG_ENABLED:-}
POSTHOG_FLUSH_INTERVAL: ${POSTHOG_FLUSH_INTERVAL:-}
JITSU_SERVER_URL: ${JITSU_SERVER_URL:-}
JITSU_SERVER_WRITE_KEY: ${JITSU_SERVER_WRITE_KEY:-}
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: ${OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:-}
Expand Down
4 changes: 4 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ services:
SENTRY_HTTP_TRACING_ENABLED: ${SENTRY_HTTP_TRACING_ENABLED:-}
SENTRY_POSTGRES_TRACKING_ENABLED: ${SENTRY_POSTGRES_TRACKING_ENABLED:-}
SENTRY_PROFILING_ENABLED: ${SENTRY_PROFILING_ENABLED:-}
POSTHOG_KEY: ${POSTHOG_KEY:-}
POSTHOG_HOST: ${POSTHOG_HOST:-}
POSTHOG_ENABLED: ${POSTHOG_ENABLED:-}
POSTHOG_FLUSH_INTERVAL: ${POSTHOG_FLUSH_INTERVAL:-}
JITSU_SERVER_URL: ${JITSU_SERVER_URL:-}
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: ${OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:-}
OTEL_EXPORTER_OTLP_HEADERS: ${OTEL_EXPORTER_OTLP_HEADERS:-}
Expand Down
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@
"build:package:plugins:pre": "yarn run build:package:ui-core && yarn run build:package:ui-auth && yarn run build:package:plugin:onboarding-ui && yarn run build:package:plugin:legal-ui && yarn run build:package:plugin:job-search-ui && yarn run build:package:plugin:job-matching-ui && yarn run build:package:plugin:job-employee-ui && yarn run build:package:plugin:job-proposal-ui && yarn run build:package:plugin:public-layout-ui && yarn run build:package:plugin:maintenance-ui && yarn run build:package:plugin:videos-ui && yarn run build:integration-ui-plugins",
"build:package:plugins:pre:prod": "yarn run build:package:ui-core:prod && yarn run build:package:ui-auth:prod && yarn run build:package:plugin:onboarding-ui:prod && yarn run build:package:plugin:legal-ui:prod && yarn run build:package:plugin:job-search-ui:prod && yarn run build:package:plugin:job-matching-ui:prod && yarn run build:package:plugin:job-employee-ui:prod && yarn run build:package:plugin:job-proposal-ui:prod && yarn run build:package:plugin:public-layout-ui:prod && yarn run build:package:plugin:maintenance-ui:prod && yarn run build:package:plugin:videos-ui:prod && yarn run build:integration-ui-plugins:prod",
"build:package:plugins:pre:docker": "yarn run build:package:ui-core:docker && yarn run build:package:ui-auth:docker && yarn run build:package:plugin:onboarding-ui:docker && yarn run build:package:plugin:legal-ui:docker && yarn run build:package:plugin:job-search-ui:docker && yarn run build:package:plugin:job-matching-ui:docker && yarn run build:package:plugin:job-employee-ui:docker && yarn run build:package:plugin:job-proposal-ui:docker && yarn run build:package:plugin:public-layout-ui:docker && yarn run build:package:plugin:maintenance-ui:docker && yarn run build:package:plugin:videos-ui:docker && yarn run build:integration-ui-plugins:docker",
"build:package:plugins:post": "yarn run build:package:plugin:integration-jira && yarn run build:package:plugin:integration-ai && yarn run build:package:plugin:sentry && yarn run build:package:plugin:jitsu-analytic && yarn run build:package:plugin:product-reviews && yarn run build:package:plugin:job-search && yarn run build:package:plugin:job-proposal && yarn run build:package:plugin:integration-github && yarn run build:package:plugin:knowledge-base && yarn run build:package:plugin:changelog && yarn run build:package:plugin:integration-hubstaff && yarn run build:package:plugin:integration-upwork && yarn run build:package:plugin:integration-make-com && yarn run build:package:plugin:videos && yarn run build:package:plugin:registry && yarn run build:package:plugin:integration-zapier",
"build:package:plugins:post:prod": "yarn run build:package:plugin:integration-jira:prod && yarn run build:package:plugin:integration-ai:prod && yarn run build:package:plugin:sentry:prod && yarn run build:package:plugin:jitsu-analytic:prod && yarn run build:package:plugin:product-reviews:prod && yarn run build:package:plugin:job-search:prod && yarn run build:package:plugin:job-proposal:prod && yarn run build:package:plugin:integration-github:prod && yarn run build:package:plugin:knowledge-base:prod && yarn run build:package:plugin:changelog:prod && yarn run build:package:plugin:integration-hubstaff:prod && yarn run build:package:plugin:integration-upwork:prod && yarn run build:package:plugin:integration-make-com:prod && yarn run build:package:plugin:videos:prod && yarn run build:package:plugin:registry:prod && yarn run build:package:plugin:integration-zapier:prod",
"build:package:plugins:post:docker": "yarn run build:package:plugin:integration-jira:docker && yarn run build:package:plugin:integration-ai:docker && yarn run build:package:plugin:sentry:docker && yarn run build:package:plugin:jitsu-analytic:docker && yarn run build:package:plugin:product-reviews:docker && yarn run build:package:plugin:job-search:docker && yarn run build:package:plugin:job-proposal:docker && yarn run build:package:plugin:integration-github:docker && yarn run build:package:plugin:knowledge-base:docker && yarn run build:package:plugin:changelog:docker && yarn run build:package:plugin:integration-hubstaff:docker && yarn run build:package:plugin:integration-upwork:docker && yarn run build:package:plugin:integration-make-com:docker && yarn run build:package:plugin:videos:docker && yarn run build:package:plugin:registry:docker && yarn run build:package:plugin:integration-zapier:docker",
"build:package:plugins:post": "yarn run build:package:plugin:integration-jira && yarn run build:package:plugin:integration-ai && yarn run build:package:plugin:sentry && yarn run build:package:plugin:posthog && yarn run build:package:plugin:jitsu-analytic && yarn run build:package:plugin:product-reviews && yarn run build:package:plugin:job-search && yarn run build:package:plugin:job-proposal && yarn run build:package:plugin:integration-github && yarn run build:package:plugin:knowledge-base && yarn run build:package:plugin:changelog && yarn run build:package:plugin:integration-hubstaff && yarn run build:package:plugin:integration-upwork && yarn run build:package:plugin:integration-make-com && yarn run build:package:plugin:videos && yarn run build:package:plugin:registry && yarn run build:package:plugin:integration-zapier",
"build:package:plugins:post:prod": "yarn run build:package:plugin:integration-jira:prod && yarn run build:package:plugin:integration-ai:prod && yarn run build:package:plugin:sentry:prod && yarn run build:package:plugin:posthog:prod && yarn run build:package:plugin:jitsu-analytic:prod && yarn run build:package:plugin:product-reviews:prod && yarn run build:package:plugin:job-search:prod && yarn run build:package:plugin:job-proposal:prod && yarn run build:package:plugin:integration-github:prod && yarn run build:package:plugin:knowledge-base:prod && yarn run build:package:plugin:changelog:prod && yarn run build:package:plugin:integration-hubstaff:prod && yarn run build:package:plugin:integration-upwork:prod && yarn run build:package:plugin:integration-make-com:prod && yarn run build:package:plugin:videos:prod && yarn run build:package:plugin:registry:prod && yarn run build:package:plugin:integration-zapier:prod",
"build:package:plugins:post:docker": "yarn run build:package:plugin:integration-jira:docker && yarn run build:package:plugin:integration-ai:docker && yarn run build:package:plugin:sentry:docker && yarn run build:package:plugin:posthog:docker && yarn run build:package:plugin:jitsu-analytic:docker && yarn run build:package:plugin:product-reviews:docker && yarn run build:package:plugin:job-search:docker && yarn run build:package:plugin:job-proposal:docker && yarn run build:package:plugin:integration-github:docker && yarn run build:package:plugin:knowledge-base:docker && yarn run build:package:plugin:changelog:docker && yarn run build:package:plugin:integration-hubstaff:docker && yarn run build:package:plugin:integration-upwork:docker && yarn run build:package:plugin:integration-make-com:docker && yarn run build:package:plugin:videos:docker && yarn run build:package:plugin:registry:docker && yarn run build:package:plugin:integration-zapier:docker",
"build:package:plugin:integration-ai": "cross-env NODE_ENV=development NODE_OPTIONS=--max-old-space-size=12288 yarn nx build plugin-integration-ai",
"build:package:plugin:integration-ai:prod": "cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=12288 yarn nx build plugin-integration-ai",
"build:package:plugin:integration-ai:docker": "cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=60000 yarn nx build plugin-integration-ai",
Expand All @@ -197,6 +197,9 @@
"build:package:plugin:sentry": "cross-env NODE_ENV=development NODE_OPTIONS=--max-old-space-size=12288 yarn nx build plugin-sentry",
"build:package:plugin:sentry:prod": "cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=12288 yarn nx build plugin-sentry",
"build:package:plugin:sentry:docker": "cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=60000 yarn nx build plugin-sentry",
"build:package:plugin:posthog": "cross-env NODE_ENV=development NODE_OPTIONS=--max-old-space-size=12288 yarn nx build plugin-posthog",
"build:package:plugin:posthog:prod": "cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=12288 yarn nx build plugin-posthog",
"build:package:plugin:posthog:docker": "cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=60000 yarn nx build plugin-posthog",
"build:package:plugin:jitsu-analytic": "cross-env NODE_ENV=development NODE_OPTIONS=--max-old-space-size=12288 yarn nx build plugin-jitsu-analytics",
"build:package:plugin:jitsu-analytic:prod": "cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=12288 yarn nx build plugin-jitsu-analytics",
"build:package:plugin:jitsu-analytic:docker": "cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=60000 yarn nx build plugin-jitsu-analytics",
Expand Down
24 changes: 24 additions & 0 deletions packages/common/src/lib/interfaces/IPosthogConfig.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* Represents a configuration object for PostHog server settings.
*/
export interface IPosthogConfig {
/**
* The PostHog API key used to authenticate requests.
*/
readonly posthogKey: string;

/**
* The host URL of the PostHog instance (e.g., https://app.posthog.com).
*/
readonly posthogHost: string;

/**
* Whether PostHog tracking is enabled.
*/
readonly posthogEnabled: boolean;

/**
* How often events are flushed (in milliseconds).
*/
readonly posthogFlushInterval: number;
}
Loading
Loading