Skip to main content
Glama
thoughtspot
by thoughtspot
mixpanel-client.ts1.19 kB
const TRACK_ENDPOINT = "https://api.mixpanel.com/track"; export class MixpanelClient { private distinctId = ""; private superProperties: { [key: string]: any } = {}; constructor(private token: string) { } identify(distinctId: string) { this.distinctId = distinctId; } register(props: { [key: string]: any }) { this.superProperties = props; } async track(eventName: string, props: { [key: string]: any }) { const payload = { event: eventName, properties: { ...this.superProperties, ...props, token: this.token, distinct_id: this.distinctId, time: new Date().getTime(), }, }; const response = await fetch(TRACK_ENDPOINT, { method: "POST", headers: { "Content-Type": "application/json", "accept": "text/plain" }, body: JSON.stringify([payload]), }); if (!response.ok) { throw new Error(`Failed to track event: ${response.statusText}`); } return response.text(); } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/thoughtspot/mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server