New doc links + copy for Plugins in Source Editor#4755
Conversation
| const defaultSource = ` | ||
| // Learn more about plugins at: https://posthog.com/docs/plugins/build/overview |
There was a problem hiding this comment.
We should leave the initial newline out, as it will appear in the code editor
| }, | ||
| global: {}, | ||
| }> | ||
| /* Runs on every event */ |
There was a problem hiding this comment.
This description could be a bit confusing, because we also have onEvent which is the one intended for running on event. processEvent should only be used for actually processing/transforming the event in flight.
| /* Runs once every full hour */ | ||
| // function runEveryHour(meta) { | ||
| // const weather = await (await fetch('https://weather.example.api/?city=New+York')).json() | ||
| // posthog.capture('weather', { degrees: weather.deg, fahrenheit: weather.us }) | ||
| // }` |
There was a problem hiding this comment.
Feels a bit weird to leave commented-out code in. I think we actually can provide a functioning runEveryHour by default
| <> | ||
| <p> | ||
| <a href="https://posthog.com/docs/plugins/build" target="_blank"> | ||
| Feeling lost?{' '} |
There was a problem hiding this comment.
Hmm, this question suggests a bit that this is a common feeling with this UX. 😅 Would rather go for a statement here, in the spirit of "BTW you can check that one page out if you want to know more"
| Read the documentation. | ||
| </a> | ||
| <br /> | ||
| Happy with your plugin?{' '} |
There was a problem hiding this comment.
This feels kind of passive aggressive 😅 Maybe a statement too
Changes
To come after PostHog/posthog.com#1467.
Also reverting the basic example to export just the special functions we mention everywhere else in the documentation.
Our starter-kit template now points to a full fledged typescript example, which explains typescript support better.
Checklist