> AI agents: this is one page from PostHog's docs. Full index of Markdown docs for LLMs: https://posthog.com/llms.txt # Quick start Canonical URL: https://posthog.com/docs/workflows/installation/quick-start ## On this page - [Send email from your server](#send-email-from-your-server) - [Capture events from your app](#capture-events-from-your-app) - [Connect your agent](#connect-your-agent) Install PostHog in up to three places: - **Your server:** the SDK sends email. - **Your app:** PostHog captures the events and people that broadcasts and automations use. If you already use PostHog for Product Analytics, this is done. - **Your coding agent:** the MCP builds your emails and reports how they did. ## Send email from your server ### Get an agent to do it Run the wizard from your server project. It creates a project secret API key, installs the SDK, and adds the first send to your code. ### Send your first email ``` npx @posthog/wizard email ``` ### Do it yourself Send yourself an email in about a minute. You don't need to set up your domain first. Until you do, PostHog sends from the [test sender](https://posthog.com/docs/workflows/email/test-sender.md), which only emails people in your PostHog organization. 1. Go to [**Project secret API keys**](https://app.posthog.com/settings/project-secret-api-keys) and click **Create project secret API key**. Set **Transactional email** to **Write**, and copy the key. It starts with `phs_`. 2. Run this, with your key and the email address of your PostHog account. On EU Cloud, use `https://eu.posthog.com`. ```bash export POSTHOG_PROJECT_SECRET_API_KEY="phs_..." curl -X POST "https://us.posthog.com/api/messaging/send/email/" \ -H "Authorization: Bearer $POSTHOG_PROJECT_SECRET_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "template_key": "hello-world", "to": "you@example.com", "subject": "Hello from PostHog", "html": "

It works.

" }' ``` 3. Check your inbox. To see the send in PostHog, open the [**Log** tab](https://posthog.com/docs/workflows/transactional.md#see-each-send). ### Install an SDK Or install the SDK yourself: | SDK | Send | `sensitive` and `tracking` | `cc`, `bcc`, and `attachments` | | --- | --- | --- | --- | | [Node.js](https://posthog.com/docs/workflows/installation/node.md) | 5.62.0 | 5.71.0 | 5.72.0 | | [Python](https://posthog.com/docs/workflows/installation/python.md) | 7.84.0 | 7.89.0 | 7.91.0 | | [Go](https://posthog.com/docs/workflows/installation/go.md) | Any v2, or 1.40.0 on v1 | Any v2, or 1.43.0 | Any v2, or 1.44.0 | | [.NET](https://posthog.com/docs/workflows/installation/dotnet.md) | 2.20.0 | 2.24.0 | 2.25.0 | | [Rust](https://posthog.com/docs/workflows/installation/rust.md) | Any `posthog`, or `posthog-rs` 0.31.0 | Any `posthog`, or 0.32.0 | Any `posthog`, or 0.33.0 | | [Ruby](https://posthog.com/docs/workflows/installation/ruby.md) | 3.30.0 | 3.33.0 | 3.34.0 | | [Elixir](https://posthog.com/docs/workflows/installation/elixir.md) | 2.20.0 | 2.21.0 | 2.22.0 | | [PHP](https://posthog.com/docs/workflows/installation/php.md) | 4.22.0 | 4.24.0 | 4.25.0 | For another language, use the [API](https://posthog.com/docs/workflows/installation/api.md). A send needs your secret API key, so send only from your server. The browser and mobile SDKs can't send email. ## Capture events from your app Install PostHog in your app or site. Its events can start an automation, such as a welcome email on `signed_up`. Its person properties choose who gets a broadcast. [Identify](https://posthog.com/docs/product-analytics/identify.md) each user and set their `email` person property, so PostHog knows where to send. `npx @posthog/wizard` ### Platforms - [![](https://res.cloudinary.com/dmukukwp6/image/upload/Android_robot_bec2fb7318.svg)Android](https://posthog.com/docs/product-analytics/installation/android.md) - [API](https://posthog.com/docs/product-analytics/installation/api.md) - [![](https://res.cloudinary.com/dmukukwp6/image/upload/posthog.com/contents/images/docs/integrate/elixir.svg)Elixir](https://posthog.com/docs/product-analytics/installation/elixir.md) - [![](https://res.cloudinary.com/dmukukwp6/image/upload/posthog.com/contents/images/docs/integrate/flutter.svg)Flutter](https://posthog.com/docs/product-analytics/installation/flutter.md) - [![](https://res.cloudinary.com/dmukukwp6/image/upload/posthog.com/contents/images/docs/integrate/go.svg)Go](https://posthog.com/docs/product-analytics/installation/go.md) - [![](https://res.cloudinary.com/dmukukwp6/image/upload/posthog.com/contents/images/docs/integrate/ios.svg)iOS](https://posthog.com/docs/product-analytics/installation/ios.md) - [![](https://res.cloudinary.com/dmukukwp6/image/upload/posthog.com/contents/images/docs/integrate/nodejs.svg)Node.js](https://posthog.com/docs/product-analytics/installation/nodejs.md) - [![](https://res.cloudinary.com/dmukukwp6/image/upload/posthog.com/contents/images/docs/integrate/php.svg)PHP](https://posthog.com/docs/product-analytics/installation/php.md) - [![](https://res.cloudinary.com/dmukukwp6/image/upload/posthog.com/contents/images/docs/integrate/python.svg)Python](https://posthog.com/docs/product-analytics/installation/python.md) - [![](https://res.cloudinary.com/dmukukwp6/image/upload/posthog.com/contents/images/docs/integrate/react.svg)React](https://posthog.com/docs/product-analytics/installation/react.md) - [![](https://res.cloudinary.com/dmukukwp6/image/upload/posthog.com/contents/images/docs/integrate/react.svg)React Native](https://posthog.com/docs/product-analytics/installation/react-native.md) - [![](https://res.cloudinary.com/dmukukwp6/image/upload/posthog.com/contents/images/docs/integrate/ruby.svg)Ruby](https://posthog.com/docs/product-analytics/installation/ruby.md) - [![](https://res.cloudinary.com/dmukukwp6/image/upload/posthog.com/contents/images/docs/integrate/js.svg)Web](https://posthog.com/docs/product-analytics/installation/web.md) ### Frameworks - [![](https://res.cloudinary.com/dmukukwp6/image/upload/posthog.com/contents/docs/integrate/frameworks/angular.svg)Angular](https://posthog.com/docs/libraries/angular.md) - [![](https://res.cloudinary.com/dmukukwp6/image/upload/astro_icon_dark_23a13977ad.svg)Astro](https://posthog.com/docs/libraries/astro.md) - [![](https://res.cloudinary.com/dmukukwp6/image/upload/posthog.com/contents/docs/integrate/frameworks/django.svg)Django](https://posthog.com/docs/libraries/django.md) - [![](https://res.cloudinary.com/dmukukwp6/image/upload/posthog.com/contents/docs/integrate/frameworks/laravel.svg)Laravel](https://posthog.com/docs/libraries/laravel.md) - [![](https://res.cloudinary.com/dmukukwp6/image/upload/posthog.com/contents/images/docs/integrate/frameworks/nextjs.svg)Next.js](https://posthog.com/docs/libraries/next-js.md) - [![](https://res.cloudinary.com/dmukukwp6/image/upload/posthog.com/contents/images/docs/integrate/frameworks/nuxt.svg)Nuxt.js](https://posthog.com/docs/libraries/nuxt-js.md) - [![](https://res.cloudinary.com/dmukukwp6/image/upload/remix_letter_glowing_49183adce2.svg)Remix](https://posthog.com/docs/libraries/remix.md) - [![](https://res.cloudinary.com/dmukukwp6/image/upload/posthog.com/contents/docs/integrate/frameworks/svelte.svg)Svelte](https://posthog.com/docs/libraries/svelte.md) - [![](https://res.cloudinary.com/dmukukwp6/image/upload/posthog.com/contents/images/docs/integrate/frameworks/vue.svg)Vue](https://posthog.com/docs/libraries/vue-js.md) ## Connect your agent The [PostHog MCP](https://posthog.com/docs/workflows/mcp.md) lets Claude Code, Cursor, Codex, and other agents write emails, build broadcasts and automations, [move you off another provider](https://posthog.com/docs/workflows/migrate.md), and report how each email did. Your agent saves its changes as drafts, and you publish them. ### Install the PostHog MCP ``` npx @posthog/wizard mcp add ``` [](https://claude.ai/directory/connectors/posthog)[](https://chatgpt.com/plugins/plugin_asdk_app_699caef2d680819188727b0ddbb349dd)[](https://posthog.com/docs/model-context-protocol/cursor.md)[](https://posthog.com/docs/model-context-protocol/vscode.md)[](https://posthog.com/docs/model-context-protocol/codex.md)