Add PostHog consent integration and extract integration plugin system
Add PostHog opt-in/opt-out consent support mirroring the existing Google Consent Mode integration: database column, GraphQL field, console UI toggle, and client-side posthog-js calls. Extract both GCM and PostHog logic from CookieBannerClient into a ConsentIntegration plugin interface so future integrations can be added without modifying the client core. Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -472,6 +472,7 @@ func (r *mutationResolver) UpdateCookieCategory(ctx context.Context, input types
|
||||
Slug: input.Slug,
|
||||
Description: input.Description,
|
||||
GCMConsentTypes: gcmConsentTypes,
|
||||
PostHogConsent: input.PosthogConsent,
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
|
||||
@@ -124,6 +124,7 @@ type CookieCategory implements Node {
|
||||
kind: CookieCategoryKind!
|
||||
rank: Int!
|
||||
gcmConsentTypes: [String!]!
|
||||
posthogConsent: Boolean!
|
||||
|
||||
cookies(
|
||||
first: Int
|
||||
@@ -310,6 +311,7 @@ input UpdateCookieCategoryInput {
|
||||
slug: String
|
||||
description: String
|
||||
gcmConsentTypes: [String!]
|
||||
posthogConsent: Boolean
|
||||
}
|
||||
|
||||
input DeleteCookieCategoryInput {
|
||||
|
||||
@@ -76,6 +76,7 @@ func NewCookieCategory(c *coredata.CookieCategory) *CookieCategory {
|
||||
Kind: c.Kind,
|
||||
Rank: c.Rank,
|
||||
GcmConsentTypes: gcmConsentTypes,
|
||||
PosthogConsent: c.PostHogConsent,
|
||||
CreatedAt: c.CreatedAt,
|
||||
UpdatedAt: c.UpdatedAt,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user