@opentabs-dev/opentabs-plugin-posthog 0.0.76 → 0.0.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -124
- package/dist/adapter.iife.js +4 -2
- package/dist/adapter.iife.js.map +2 -2
- package/dist/tools.json +1 -1
- package/package.json +10 -4
package/README.md
CHANGED
|
@@ -1,159 +1,122 @@
|
|
|
1
|
-
#
|
|
1
|
+
# PostHog
|
|
2
2
|
|
|
3
|
-
OpenTabs plugin for PostHog
|
|
3
|
+
OpenTabs plugin for PostHog — gives AI agents access to PostHog through your authenticated browser session.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Install
|
|
6
6
|
|
|
7
|
+
```bash
|
|
8
|
+
opentabs plugin install posthog
|
|
7
9
|
```
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
│ ├── index.ts # Plugin class (extends OpenTabsPlugin)
|
|
14
|
-
│ └── tools/ # One file per tool (using defineTool)
|
|
15
|
-
│ └── example.ts
|
|
16
|
-
└── dist/ # Build output (generated)
|
|
17
|
-
├── adapter.iife.js # Bundled adapter injected into matching tabs
|
|
18
|
-
└── tools.json # Tool schemas for MCP registration
|
|
10
|
+
|
|
11
|
+
Or install globally via npm:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install -g @opentabs-dev/opentabs-plugin-posthog
|
|
19
15
|
```
|
|
20
16
|
|
|
21
|
-
##
|
|
17
|
+
## Setup
|
|
22
18
|
|
|
23
|
-
|
|
19
|
+
1. Open [us.posthog.com](https://us.posthog.com) in Chrome and log in
|
|
20
|
+
2. Open the OpenTabs side panel — the PostHog plugin should appear as **ready**
|
|
24
21
|
|
|
25
|
-
|
|
26
|
-
{
|
|
27
|
-
"name": "opentabs-plugin-posthog",
|
|
28
|
-
"main": "dist/adapter.iife.js",
|
|
29
|
-
"opentabs": {
|
|
30
|
-
"displayName": "PostHog",
|
|
31
|
-
"description": "OpenTabs plugin for PostHog",
|
|
32
|
-
"urlPatterns": ["*://*.us.posthog.com/*"]
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
```
|
|
22
|
+
## Tools (32)
|
|
36
23
|
|
|
37
|
-
|
|
38
|
-
- **`opentabs.displayName`** — human-readable name shown in the side panel
|
|
39
|
-
- **`opentabs.description`** — short description of what the plugin does
|
|
40
|
-
- **`opentabs.urlPatterns`** — Chrome match patterns for tabs where the adapter is injected
|
|
24
|
+
### Users (1)
|
|
41
25
|
|
|
42
|
-
|
|
26
|
+
| Tool | Description | Type |
|
|
27
|
+
|---|---|---|
|
|
28
|
+
| `get_current_user` | Get your PostHog profile | Read |
|
|
43
29
|
|
|
44
|
-
|
|
30
|
+
### Organization (1)
|
|
45
31
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
├── icon.svg ← custom icon (optional)
|
|
50
|
-
├── icon-inactive.svg ← manual inactive override (optional, requires icon.svg)
|
|
51
|
-
├── src/
|
|
52
|
-
│ └── ...
|
|
53
|
-
```
|
|
32
|
+
| Tool | Description | Type |
|
|
33
|
+
|---|---|---|
|
|
34
|
+
| `get_organization` | Get current organization info | Read |
|
|
54
35
|
|
|
55
|
-
|
|
36
|
+
### Projects (2)
|
|
56
37
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
38
|
+
| Tool | Description | Type |
|
|
39
|
+
|---|---|---|
|
|
40
|
+
| `list_projects` | List projects in the organization | Read |
|
|
41
|
+
| `get_project` | Get project details | Read |
|
|
60
42
|
|
|
61
|
-
|
|
43
|
+
### Dashboards (5)
|
|
62
44
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
45
|
+
| Tool | Description | Type |
|
|
46
|
+
|---|---|---|
|
|
47
|
+
| `list_dashboards` | List dashboards in the project | Read |
|
|
48
|
+
| `get_dashboard` | Get dashboard details | Read |
|
|
49
|
+
| `create_dashboard` | Create a new dashboard | Write |
|
|
50
|
+
| `update_dashboard` | Update a dashboard | Write |
|
|
51
|
+
| `delete_dashboard` | Delete a dashboard | Write |
|
|
67
52
|
|
|
68
|
-
|
|
53
|
+
### Insights (4)
|
|
69
54
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
```
|
|
55
|
+
| Tool | Description | Type |
|
|
56
|
+
|---|---|---|
|
|
57
|
+
| `list_insights` | List insights in the project | Read |
|
|
58
|
+
| `get_insight` | Get insight details | Read |
|
|
59
|
+
| `update_insight` | Update an insight | Write |
|
|
60
|
+
| `delete_insight` | Delete an insight | Write |
|
|
77
61
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
Create a new file in `src/tools/` using `defineTool`:
|
|
81
|
-
|
|
82
|
-
```ts
|
|
83
|
-
import { z } from 'zod';
|
|
84
|
-
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
85
|
-
|
|
86
|
-
export const myTool = defineTool({
|
|
87
|
-
name: 'my_tool',
|
|
88
|
-
displayName: 'My Tool',
|
|
89
|
-
description: 'What this tool does',
|
|
90
|
-
icon: 'wrench',
|
|
91
|
-
input: z.object({ /* ... */ }),
|
|
92
|
-
output: z.object({ /* ... */ }),
|
|
93
|
-
handle: async (params) => {
|
|
94
|
-
// Tool implementation runs in the browser tab context
|
|
95
|
-
return { /* ... */ };
|
|
96
|
-
},
|
|
97
|
-
});
|
|
98
|
-
```
|
|
62
|
+
### Feature Flags (5)
|
|
99
63
|
|
|
100
|
-
|
|
64
|
+
| Tool | Description | Type |
|
|
65
|
+
|---|---|---|
|
|
66
|
+
| `list_feature_flags` | List feature flags | Read |
|
|
67
|
+
| `get_feature_flag` | Get feature flag details | Read |
|
|
68
|
+
| `create_feature_flag` | Create a new feature flag | Write |
|
|
69
|
+
| `update_feature_flag` | Update a feature flag | Write |
|
|
70
|
+
| `delete_feature_flag` | Delete a feature flag | Write |
|
|
101
71
|
|
|
102
|
-
|
|
72
|
+
### Experiments (3)
|
|
103
73
|
|
|
104
|
-
|
|
74
|
+
| Tool | Description | Type |
|
|
75
|
+
|---|---|---|
|
|
76
|
+
| `list_experiments` | List experiments | Read |
|
|
77
|
+
| `get_experiment` | Get experiment details | Read |
|
|
78
|
+
| `create_experiment` | Create a new experiment | Write |
|
|
105
79
|
|
|
106
|
-
|
|
107
|
-
import { getLocalStorage, getCookie, getPageGlobal } from '@opentabs-dev/plugin-sdk';
|
|
80
|
+
### Annotations (3)
|
|
108
81
|
|
|
109
|
-
|
|
110
|
-
|
|
82
|
+
| Tool | Description | Type |
|
|
83
|
+
|---|---|---|
|
|
84
|
+
| `list_annotations` | List annotations | Read |
|
|
85
|
+
| `create_annotation` | Create a new annotation | Write |
|
|
86
|
+
| `delete_annotation` | Delete an annotation | Write |
|
|
111
87
|
|
|
112
|
-
|
|
113
|
-
const session = getCookie('session_id');
|
|
88
|
+
### Persons (2)
|
|
114
89
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
90
|
+
| Tool | Description | Type |
|
|
91
|
+
|---|---|---|
|
|
92
|
+
| `list_persons` | List tracked persons | Read |
|
|
93
|
+
| `get_person` | Get person details | Read |
|
|
118
94
|
|
|
119
|
-
|
|
95
|
+
### Cohorts (2)
|
|
120
96
|
|
|
121
|
-
|
|
97
|
+
| Tool | Description | Type |
|
|
98
|
+
|---|---|---|
|
|
99
|
+
| `list_cohorts` | List cohorts | Read |
|
|
100
|
+
| `get_cohort` | Get cohort details | Read |
|
|
122
101
|
|
|
123
|
-
|
|
102
|
+
### Surveys (2)
|
|
124
103
|
|
|
125
|
-
|
|
104
|
+
| Tool | Description | Type |
|
|
105
|
+
|---|---|---|
|
|
106
|
+
| `list_surveys` | List surveys | Read |
|
|
107
|
+
| `get_survey` | Get survey details | Read |
|
|
126
108
|
|
|
127
|
-
|
|
128
|
-
// src/schemas/channel.ts
|
|
129
|
-
import { z } from 'zod';
|
|
109
|
+
### Actions (2)
|
|
130
110
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
111
|
+
| Tool | Description | Type |
|
|
112
|
+
|---|---|---|
|
|
113
|
+
| `list_actions` | List actions | Read |
|
|
114
|
+
| `get_action` | Get action details | Read |
|
|
135
115
|
|
|
136
|
-
|
|
137
|
-
```
|
|
116
|
+
## How It Works
|
|
138
117
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
// src/tools/list-channels.ts
|
|
143
|
-
import { channelSchema } from '../schemas/channel.js';
|
|
144
|
-
|
|
145
|
-
export const listChannels = defineTool({
|
|
146
|
-
name: 'list_channels',
|
|
147
|
-
displayName: 'List Channels',
|
|
148
|
-
description: 'List all available channels',
|
|
149
|
-
icon: 'list',
|
|
150
|
-
input: z.object({}),
|
|
151
|
-
output: z.object({ channels: z.array(channelSchema) }),
|
|
152
|
-
handle: async () => {
|
|
153
|
-
// ...
|
|
154
|
-
return { channels: [] };
|
|
155
|
-
},
|
|
156
|
-
});
|
|
157
|
-
```
|
|
118
|
+
This plugin runs inside your PostHog tab through the [OpenTabs](https://opentabs.dev) Chrome extension. It uses your existing browser session — no API tokens or OAuth apps required. All operations happen as you, with your permissions.
|
|
119
|
+
|
|
120
|
+
## License
|
|
158
121
|
|
|
159
|
-
|
|
122
|
+
MIT
|
package/dist/adapter.iife.js
CHANGED
|
@@ -434,6 +434,8 @@
|
|
|
434
434
|
* (e.g., 'https://github.com'), not a match pattern.
|
|
435
435
|
*/
|
|
436
436
|
homepage;
|
|
437
|
+
/** Typed configuration schema — declares settings that users provide via config.json or the side panel. */
|
|
438
|
+
configSchema;
|
|
437
439
|
};
|
|
438
440
|
|
|
439
441
|
// src/posthog-api.ts
|
|
@@ -15394,7 +15396,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15394
15396
|
};
|
|
15395
15397
|
var src_default = new PostHogPlugin();
|
|
15396
15398
|
|
|
15397
|
-
// dist/
|
|
15399
|
+
// dist/_adapter_entry_723ab4ab-ddb0-4214-9e87-40acc7ba6770.ts
|
|
15398
15400
|
if (!globalThis.__openTabs) {
|
|
15399
15401
|
globalThis.__openTabs = {};
|
|
15400
15402
|
} else {
|
|
@@ -15610,5 +15612,5 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15610
15612
|
};
|
|
15611
15613
|
delete src_default.onDeactivate;
|
|
15612
15614
|
}
|
|
15613
|
-
})();(function(){var o=(globalThis).__openTabs;if(o&&o.adapters&&o.adapters["posthog"]){var a=o.adapters["posthog"];a.__adapterHash="
|
|
15615
|
+
})();(function(){var o=(globalThis).__openTabs;if(o&&o.adapters&&o.adapters["posthog"]){var a=o.adapters["posthog"];a.__adapterHash="1026154aded861bbef3a8bbc18b2d14e7e3be94423f9904f89eaeb658b45a53d";if(a.tools&&Array.isArray(a.tools)){for(var i=0;i<a.tools.length;i++){Object.freeze(a.tools[i]);}Object.freeze(a.tools);}Object.freeze(a);Object.defineProperty(o.adapters,"posthog",{value:a,writable:false,configurable:false,enumerable:true});Object.defineProperty(o,"adapters",{value:o.adapters,writable:false,configurable:false});}})();
|
|
15614
15616
|
//# sourceMappingURL=adapter.iife.js.map
|