Socket
Book a DemoInstallSign in
Socket

@posthog/plugin-server

Package Overview
Dependencies
Maintainers
4
Versions
205
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@posthog/plugin-server

PostHog Plugin Server

Source
npmnpm
Version
0.6.7
Version published
Weekly downloads
1.8K
-27.12%
Maintainers
4
Weekly downloads
 
Created
Source

PostHog Plugin Server

npm package MIT License

This service takes care of processing events with plugins and more.

Get started

Let's get you developing the plugin server in no time:

  • Install dependencies and prepare for takeoff by running command yarn.

  • Start a development instance of PostHog. After all, this is the PostHog Plugin Server, and it works in conjuction with the main server. To avoid interference, disable the plugin server there.

  • Make sure that the plugin server is configured correctly (see Configuration). Two settings that you MUST get right are DATABASE_URL and REDIS_URL - they need to be identical between the plugin server and the main server.

  • If developing the enterprise Kafka + ClickHouse pipeline, set KAFKA_ENABLED to true and provide KAFKA_HOSTS.

    Otherwise if developing the basic Redis + Postgres pipeline, skip ahead.

  • Start the plugin server in autoreload mode with yarn start, or in compiled mode with yarn build && yarn start:dist, and develop away!

  • Run tests with yarn test. Run benchmarks with yarn benchmark.

Configuration

There's a multitude of settings you can use to control the plugin server. Use them as environment variables.

NameDescriptionDefault value
DATABASE_URLPostgres database URL'postgres://localhost:5432/posthog'
REDIS_URLRedis store URL'redis://localhost'
BASE_DIRbase path for resolving local plugins'.'
WORKER_CONCURRENCYnumber of concurrent worker threads0 – all cores
TASKS_PER_WORKERnumber of parallel tasks per worker thread10
SCHEDULE_LOCK_TTLHow many seconds to hold the lock for the schedule60
CELERY_DEFAULT_QUEUECelery outgoing queue'celery'
PLUGINS_CELERY_QUEUECelery incoming queue'posthog-plugins'
PLUGINS_RELOAD_PUBSUB_CHANNELRedis channel for reload events'reload-plugins'
KAFKA_ENABLEDuse Kafka instead of Celery to ingest eventsfalse
KAFKA_HOSTScomma-delimited Kafka hostsnull
KAFKA_CLIENT_CERT_B64Kafka certificate in Base64null
KAFKA_CLIENT_CERT_KEY_B64Kafka certificate key in Base64null
KAFKA_TRUSTED_CERT_B64Kafka trusted CA in Base64null
DISABLE_WEBwhether to disable web servertrue
WEB_PORTport for web server to listen on3008
WEB_HOSTNAMEhostname for web server to listen on'0.0.0.0'
LOG_LEVELminimum log levelLogLevel.Info
SENTRY_DSNSentry ingestion URLnull
STATSD_HOSTStatsD host - integration disabled if this is not providednull
STATSD_PORTStatsD port8125
STATSD_PREFIXStatsD prefix'plugin-server.'

Questions?

Join our Slack community.

FAQs

Package last updated on 21 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts