PostHogAnalytics
Defined in: plugins/holocron-plugin-posthog/src/capabilities/analytics.ts:11
The analytics capability for PostHog: finds or creates a project and reports its API token.
Implements
Section titled “Implements”Analytics
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new PostHogAnalytics(
client,opts):PostHogAnalytics
Defined in: plugins/holocron-plugin-posthog/src/capabilities/analytics.ts:17
Parameters
Section titled “Parameters”client
Section titled “client”() => object
Returns
Section titled “Returns”PostHogAnalytics
Properties
Section titled “Properties”
readonlykey:"analytics"
Defined in: plugins/holocron-plugin-posthog/src/capabilities/analytics.ts:13
The capability key, always analytics.
Implementation of
Section titled “Implementation of”Analytics.key
providerName
Section titled “providerName”
readonlyproviderName:"posthog"="posthog"
Defined in: plugins/holocron-plugin-posthog/src/capabilities/analytics.ts:15
The provider name, posthog.
Implementation of
Section titled “Implementation of”Analytics.providerName
Accessors
Section titled “Accessors”resolvedHost
Section titled “resolvedHost”Get Signature
Section titled “Get Signature”get resolvedHost():
string
Defined in: plugins/holocron-plugin-posthog/src/capabilities/analytics.ts:45
The host value to push as NEXT_PUBLIC_POSTHOG_HOST.
Returns
Section titled “Returns”string
Methods
Section titled “Methods”describe()
Section titled “describe()”describe():
Promise<{envKeys:string[];provider:string; }>
Defined in: plugins/holocron-plugin-posthog/src/capabilities/analytics.ts:22
Returns the env var names the app reads at runtime for this provider.
Returns
Section titled “Returns”Promise<{ envKeys: string[]; provider: string; }>
Implementation of
Section titled “Implementation of”Analytics.describe
ensureProject()
Section titled “ensureProject()”ensureProject(
name):Promise<{alreadyExists:boolean;token:string; }>
Defined in: plugins/holocron-plugin-posthog/src/capabilities/analytics.ts:36
Returns the API token of the project called name, creating the project when it does not exist yet; alreadyExists says which happened.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<{ alreadyExists: boolean; token: string; }>
Implementation of
Section titled “Implementation of”Analytics.ensureProject
whoami()
Section titled “whoami()”whoami():
Promise<{org:string; }>
Defined in: plugins/holocron-plugin-posthog/src/capabilities/analytics.ts:30
Returns the organization slug of the user the token belongs to.
Returns
Section titled “Returns”Promise<{ org: string; }>
Implementation of
Section titled “Implementation of”Analytics.whoami