Public
Versions
- Open: VersionChanges from v8 to v9+15-2⦚ 4 unchanged lines ⦚"distinct_id": me.email,};
let result = await fetch("https://app.posthog.com/capture", {method: "POST",headers: {⦚ 8 unchanged lines ⦚return result;}})();⦚ 4 unchanged lines ⦚"distinct_id": me.email,};let result = await fetch("https://app.posthog.com/capture/", {method: "POST",headers: {⦚ 8 unchanged lines ⦚return result;}})();// POST https://[your-instance].com/capture/// Content-Type: application/json// Body:// {// "api_key": "<ph_project_api_key>",// "event": "[event name]",// "distinct_id": "[your users' distinct id]",// "properties": {// "key1": "value1",// "key2": "value2"// },// "timestamp": "[optional timestamp in ISO 8601 format]"// } - Open: VersionChanges from v7 to v8+0-1⦚ 11 unchanged lines ⦚body: JSON.stringify(body),}).then((r) => r.json());
console.log("hi");if (result.error) {throw new Error("PH error " + result.error.message);}⦚ 4 unchanged lines ⦚⦚ 11 unchanged lines ⦚body: JSON.stringify(body),}).then((r) => r.json());if (result.error) {throw new Error("PH error " + result.error.message);}⦚ 4 unchanged lines ⦚ - Open: VersionChanges from v6 to v7+1-1⦚ 18 unchanged lines ⦚return result;}
});⦚ 18 unchanged lines ⦚return result;}})(); - Open: VersionChanges from v5 to v6+2-2
async function postHogAPICapture() {const body = {"api_key": me.phProjectAPIKey,⦚ 15 unchanged lines ⦚return result;}}let postHogAPICapture = (async () => {const body = {"api_key": me.phProjectAPIKey,⦚ 15 unchanged lines ⦚return result;}}); - Open: VersionChanges from v4 to v5+0-0⦚ 21 unchanged lines ⦚⦚ 21 unchanged lines ⦚
- Open: VersionChanges from v3 to v4+1-0⦚ 11 unchanged lines ⦚body: JSON.stringify(body),}).then((r) => r.json());
if (result.error) {throw new Error("PH error " + result.error.message);}⦚ 4 unchanged lines ⦚⦚ 11 unchanged lines ⦚body: JSON.stringify(body),}).then((r) => r.json());console.log("hi");if (result.error) {throw new Error("PH error " + result.error.message);}⦚ 4 unchanged lines ⦚ - Open: VersionChanges from v2 to v3+4-1⦚ 6 unchanged lines ⦚let result = await fetch("https://app.posthog.com/capture", {method: "POST",
body: body,}).then((r) => r.json());if (result.error) {⦚ 6 unchanged lines ⦚⦚ 6 unchanged lines ⦚let result = await fetch("https://app.posthog.com/capture", {method: "POST",headers: {"Content-Type": "application/json",},body: JSON.stringify(body),}).then((r) => r.json());if (result.error) {⦚ 6 unchanged lines ⦚ - Open: VersionChanges from v1 to v2+0-0⦚ 17 unchanged lines ⦚⦚ 17 unchanged lines ⦚
- Open: Version+17-0async function postHogAPICapture() {const body = {"api_key": me.phProjectAPIKey,"event": "val API ran","distinct_id": me.email,};let result = await fetch("https://app.posthog.com/capture", {method: "POST",body: body,}).then((r) => r.json());if (result.error) {throw new Error("PH error " + result.error.message);}else {return result;}}
Updated: October 23, 2023