# PolicyGrain Complete Documentation Corpus
Source: https://docs.policygrain.com
OpenAPI 3.1.0: https://docs.policygrain.com/openapi.json
Skill: https://docs.policygrain.com/SKILL.md
---
# What PolicyGrain does
PolicyGrain generates ten cited DPDP Act, IT (SPDI), Consumer Protection Act, and CERT-In documents from plain answers, serves a 4.94 KB gzipped equal-choice consent banner, verifies installs in headless Chromium, and seals consent receipts in SHA-256 hash chains with daily Ed25519 Merkle roots.
## Platform modules
1. Cited Notices (modules/legal-corpus & modules/documents): 10 document kinds assembled deterministically from pinned legal-sources with inline statutory citations (s.5(1), r.3), in English today; Hindi and the other Eighth Schedule languages are rolling out next.
2. Hosted Pages (modules/hosted-docs): publish approved versions to pages.policygrain.com with zero JavaScript and zero cookies.
3. Consent Banner v2 (modules/sites & browser/banner): 4.94 KB gzipped loader (12.70 KB total), DPDP s.6(4) equal-choice Accept/Reject, all 7 Google Consent Mode v2 signals, synchronous returning-visitor restore, native Global Privacy Control, and Shadow DOM click-to-load iframe blocking.
4. Evidence Ledger (modules/evidence & modules/usage): HMAC-SHA256 IP hashing, insert-only DB role, per-site SHA-256 hash chain, daily Ed25519 Merkle roots (evidence.evidence_roots), limit-aware JSON/CSV export with formula neutralization, and a 10,000 monthly free-tier counter that never blocks ingest.
5. CheckMyDPDP Scanner & Verification (modules/scanner & modules/verify): isolated 3-pass headless Chromium checks across 11 evidence-backed observations, plus a 100% local Chrome MV3 Inspector extension.
6. Ecosystem Plugins & Coding Agents: GTM Community Template, WordPress Plugin, Shopify Theme App Extension, @policygrain/react & Next.js SDK, @policygrain/mcp (16 tools), @policygrain/cli, and SKILL.md v0.9.
## Reading these docs with an agent
- Fetch /llms.txt for the structured index, or /llms-full.txt for the complete concatenated Markdown corpus.
- Append .md to any documentation path (or /index.md for this page) for clean Markdown.
- Fetch /openapi.json (or https://api.policygrain.com/v1/openapi.json) for the merged OpenAPI 3.1.0 contract.
- Fetch /SKILL.md for the v0.9 coding-agent operational playbook.
---
# 5-minute DPDP quickstart
Mint a scoped API key, create a profile, publish a cited privacy notice, install the 4.94 KB gzipped banner loader, and export a verifiable receipt pack.
## 1. Mint a scoped API key
Call POST /v1/keys with the website owner's email and the narrowest scopes needed. Store the returned pgk_ secret in POLICYGRAIN_API_KEY and never commit it to git.
#### cURL
```bash
curl -X POST https://api.policygrain.com/v1/keys \
-H "Content-Type: application/json" \
-d '{"email": "owner@example.in", "scopes": ["documents", "sites:write"]}'
```
#### CLI
```bash
npx policygrain init --domain example.in
npx checkmydpdp https://example.in --json
```
#### TypeScript SDK
```ts
import { createClient, httpTransport } from "@policygrain/sdk";
const client = createClient({
transport: httpTransport({
baseUrl: "https://api.policygrain.com",
tokens: { token: () => process.env.POLICYGRAIN_API_KEY ?? null },
}),
});
const account = await client.account();
```
#### MCP
```json
{
"mcpServers": {
"policygrain": {
"command": "npx",
"args": ["-y", "@policygrain/mcp"],
"env": { "POLICYGRAIN_API_KEY": "${POLICYGRAIN_API_KEY}" }
}
}
}
```
## 2. Create a profile and generate cited notices
Read GET /v1/questions to see the pinned Tier 1 question set, create a profile with POST /v1/profiles, trigger POST /v1/generations, and publish the approved version to pages.policygrain.com.
```bash
curl -X POST https://api.policygrain.com/v1/generations \
-H "Authorization: Bearer $POLICYGRAIN_API_KEY" \
-H "Idempotency-Key: gen-001" \
-H "Content-Type: application/json" \
-d '{"profile_id": "prof_01..."}'
```
## 3. Verify your domain and embed Consent Banner v2
Register your site with POST /v1/sites, verify domain ownership via DNS TXT or HTTPS well-known file at POST /v1/sites/{id}/domains/{domain}/verify, publish your banner config, and drop the single script tag into your root layout.
#### HTML
```html
```
#### React / Next.js
```tsx
import { PolicyGrainProvider, PolicyGrainScript } from "@policygrain/react/next";
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
{children}
);
}
```
#### WordPress / GTM
```bash
# WordPress: Activate PolicyGrain DPDP plugin, enter Site Key in Settings > PolicyGrain
# Shortcode for hosted notice embed:
[policygrain_notice slug="example-privacy"]
```
## 4. Verify in Chromium and export signed receipts
Run POST /v1/sites/{id}/verifications to confirm the banner loads before optional scripts fire, then inspect daily Ed25519 Merkle roots at GET /v1/sites/{id}/seal and export a date-bounded JSON/CSV evidence pack.
---
# Concepts
Six architectural invariants govern every API route, browser script, and generated notice in PolicyGrain.
## API keys, scopes and account claiming
Every authenticated route accepts Authorization: Bearer with either a pgk_ API key or a 15-minute pgs_ web session token. Four scopes gate access: documents, sites:write, evidence:read (requires a verified account), and keys.
When a coding agent creates an unverified account via POST /v1/keys and the human owner later signs in via WorkOS, every pre-claim key becomes suspended (403 key_suspended) until the owner explicitly keeps or revokes it on /keys.
## Questions, tiers and visibility
Tier 1 questions capture the core data-processing facts shown in the web app. Tier 2 questions refine optional clauses through the API and carry shows_if conditions evaluated deterministically against earlier answers.
## Cited documents, provenance and material_version
Documents are assembled deterministically from pinned policygrain/legal-sources templates—never hallucinated per customer. Identical answer digests reuse content-addressed versions, and every clause retains its statutory register citation (such as DPDP Act s.5(1) or DPDP Rules r.3).
> **Deterministic assembly (ADR 0014)**: PolicyGrain is not a law firm and does not give legal advice. Every generated notice ends with its pinned corpus provenance and requires explicit owner confirmation before publication.
## Owner answers vs agent-inferred answers
Answers submitted by coding agents are tagged source: 'agent_inferred' and hold generated documents in draft state until the human account owner confirms them via PATCH /v1/profiles/{id} with confirm.
## Sites, verified domains and versioned banner configs
Each site verifies domain ownership via DNS TXT or HTTPS well-known challenge before live browser verification runs. Banner configurations are immutable numbered versions published to the CDN; incrementing material_version prompts returning visitors to re-confirm.
## Consent receipts, trust classes and Merkle seals
Visitor choices arrive at POST /v1/receipts, are classified by origin and config match (origin_ok, origin_unexpected, config_mismatch, rate_flagged), written by an insert-only PostgreSQL role into a per-site SHA-256 chain, and sealed daily with Ed25519 Merkle roots.
---
# Generate cited notices (10 document kinds)
PolicyGrain renders ten deterministic documents mapped to the DPDP Act 2023, DPDP Rules 2025, IT (SPDI) Rules 2011, Consumer Protection Act, and CERT-In directions.
## All 10 supported document kinds
Document types generated by modules/documents and modules/legal-corpus
| doc_type | Document | Primary statutory anchor |
| --- | --- | --- |
| privacy-notice | Privacy Notice | DPDP Act s.5(1), DPDP Rules r.3, SPDI r.4(1) |
| re-notice | Notice to Existing Users | DPDP Act s.5(2) |
| consent-notice | Consent Notice | DPDP Act s.5(1) & s.6(1) |
| short-notice | Just-in-Time Short Notice | DPDP Act s.5(1), SPDI r.5(3) |
| rights-grievance | Data Principal Rights & Grievance Page | DPDP Act ss.11–14, DPDP Rules r.9 & r.14 |
| cookie | Cookie & Tracker Notice | DPDP Act s.6(1) & s.6(4) |
| dpa | Data Processing Agreement | DPDP Act s.8(2) |
| terms | Terms of Service | IT (Intermediary Guidelines) Rules r.3(1) |
| aup | Acceptable Use Policy | IT Rules r.3(1)(b) |
| disclaimer | Legal & Platform Disclaimer | Consumer Protection (E-Commerce) Rules & CERT-In |
## Create a profile and submit answers
#### cURL
```bash
curl -X POST https://api.policygrain.com/v1/profiles \
-H "Authorization: Bearer $POLICYGRAIN_API_KEY" \
-H "Idempotency-Key: prof-init-1" \
-H "Content-Type: application/json" \
-d '{
"answers": {
"M-02": ["saas", "ai"],
"M-04": "yes",
"M-07": ["service_delivery", "account", "billing", "analytics"]
},
"fields": {
"org.legal_name": "Example Private Limited",
"org.website": "https://example.in",
"officer.name": "Asha Menon",
"officer.email": "grievance@example.in",
"contact.privacy": "privacy@example.in"
}
}'
```
#### TypeScript SDK
```ts
const profile = await client.createProfile({
answers: {
"M-02": ["saas", "ai"],
"M-04": "yes",
"M-07": ["service_delivery", "account", "billing", "analytics"],
},
fields: {
"org.legal_name": "Example Private Limited",
"org.website": "https://example.in",
"officer.name": "Asha Menon",
"officer.email": "grievance@example.in",
"contact.privacy": "privacy@example.in",
},
});
```
## Start generation, check provenance and download
Call POST /v1/generations with your profile_id and poll GET /v1/generations/{id} until status is done. Fetch GET /v1/documents/{id}/versions/latest for JSON + full statutory provenance, or append ?format=html or ?format=md for standalone outputs.
Answer keys are question ids from GET /v1/questions (M-02, M-04, M-07, ...); field keys are the dotted legal-sources field ids (org.legal_name, officer.email, contact.privacy, ...). An answer can also be sent as {"value": ..., "source": "agent_inferred"}; the owner then confirms it before the document can be final.
> **Languages**: Generated documents are in English today. DPDP Act s.5(3) lets a Data Principal ask for a notice in English or any language in the Eighth Schedule to the Constitution; Hindi and the other Eighth Schedule languages are rolling out next. Each clause version records its pinned legal-sources commit hash.
---
# Refine clauses with Tier 2 questions (API)
Tier 2 questions refine sector-specific processing, retention schedules, cross-border transfers, and children's data handling beyond the Tier 1 set.
## When to use Tier 2 questions
Read GET /v1/questions and filter for tier: 2. Each question includes shows_if conditions and an affects array listing exactly which document types change when you answer it.
## Patch answers and confirm inferred values
```bash
curl -X PATCH https://api.policygrain.com/v1/profiles/prof_01... \
-H "Authorization: Bearer $POLICYGRAIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"answers": { "T2-04": "90_days" },
"confirm": ["M-01", "M-02"]
}'
```
## Regenerate with content-addressed versions
Call POST /v1/generations after patching. Only documents whose inputs changed receive a new version number; unchanged documents preserve their prior version and material_version.
---
# Publish hosted document pages
Hosted pages on pages.policygrain.com render pure semantic HTML with zero scripts and zero cookies, ensuring privacy notices never themselves track visitors.
## Requirements before publishing
- The target document version must be in final state (all agent_inferred answers confirmed by the owner).
- The caller holds the documents scope or a signed-in web session.
## Publish via PUT /v1/documents/{id}/publication
```bash
curl -X PUT https://api.policygrain.com/v1/documents/doc_01.../publication \
-H "Authorization: Bearer $POLICYGRAIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"slug": "example-privacy"}'
```
PUT publishes the newest final version. The body takes only slug, and only the first time: the slug then stays this document's, so later calls send {} (or the same slug) and a different slug is refused. The call is idempotent; it answers 200 once the page is live and 202 while the edge is still syncing.
Link the returned https://pages.policygrain.com/{slug} URL from your website footer and banner notice link. Previous published versions remain readable at /{slug}/versions/{n}.
## Unpublishing and material_version bumps
Call DELETE /v1/documents/{id}/publication to unpublish and purge the hosted page from the edge. When a published privacy or consent notice changes materially, bump your banner config material_version so returning visitors see the updated notice.
---
# Consent Banner v2 (4.94 KB gzipped)
Consent Banner v2 ships a 4.94 KB gzipped loader (12.70 KB total), enforces DPDP s.6(4) equal-choice Accept/Reject prominence, bridges all 7 Google Consent Mode v2 signals, honours Global Privacy Control, and blocks third-party embeds until consent.
## What Consent Banner v2 enforces by default
Shipped browser/banner v2 technical specifications
| Capability | Implementation |
| --- | --- |
| Bundle budget | 4.94 KB gzipped loader; 12.70 KB total with renderer |
| DPDP s.6(4) parity | Equal-weight Accept and Reject controls on layer 1; zero pre-ticked optional toggles; zero scroll lock |
| Google Consent Mode v2 | All 7 signals (ad_storage, analytics_storage, ad_user_data, ad_personalization, functionality_storage, personalization_storage, security_storage) |
| Returning visitors | Synchronous cookie/localStorage restore before tag initialization; expired or older material_version re-prompts cleanly |
| Global Privacy Control | Reads navigator.globalPrivacyControl; respects opt-out signals automatically |
| Iframe blocking | Shadow DOM click-to-load placeholders for YouTube, Google Maps, and Vimeo embeds until visitor opts in |
## 1. Register site, verify domain and publish config
```bash
# 1. Verify domain ownership (DNS TXT or /.well-known/policygrain-verify.txt)
curl -X POST https://api.policygrain.com/v1/sites/site_01.../domains/example.in/verify \
-H "Authorization: Bearer $POLICYGRAIN_API_KEY"
# 2. Publish banner config version 1 to cdn.policygrain.com
# (publish takes a numeric version; read GET /v1/sites/{id}/configs/latest to find the newest n)
curl -X POST https://api.policygrain.com/v1/sites/site_01.../configs/1/publish \
-H "Authorization: Bearer $POLICYGRAIN_API_KEY" \
-H "Idempotency-Key: pub-banner-1"
```
## 2. Add the script tag and gate optional scripts or iframes
#### HTML Snippet
```html
```
#### React / Next.js
```tsx
import { PolicyGrainGate, usePolicyGrainConsent } from "@policygrain/react";
export function MapEmbed() {
const { openPreferences } = usePolicyGrainConsent();
return (
Allow analytics to load map}
>
);
}
```
#### JavaScript API
```ts
// The loader dispatches policygrain:choice on document after every saved choice.
document.addEventListener("policygrain:choice", (event) => {
const { kind, choices } = (
event as CustomEvent<{
kind: "consent" | "reject" | "withdraw" | "reconsent";
choices: Record;
}>
).detail;
if (choices.analytics === true) {
// Initialize the optional analytics SDK
} else if (kind === "withdraw") {
// Stop it; the loader reloads the page if a script that already ran lost consent
}
});
// Reopen the banner from your own button (the withdraw view after a choice)
document.querySelector("#privacy-choices")?.addEventListener("click", () => {
window.PolicyGrain?.open();
});
```
## 3. Withdrawal control (DPDP s.6(4))
Visitors must be able to withdraw consent as easily as they gave it. Enable the built-in floating preference button in your banner config or give your own footer link a data-pg-open attribute (or call window.PolicyGrain?.open() from it). After a choice, open() shows the withdraw view.
---
# Verify your live install
modules/verify runs the shared SSRF-hardened Playwright BrowserSandbox against your verified domain to check that the loader fires, the banner renders, and optional trackers wait for choice.
## Start a verification check
#### cURL
```bash
curl -X POST https://api.policygrain.com/v1/sites/site_01.../verifications \
-H "Authorization: Bearer $POLICYGRAIN_API_KEY" \
-H "Idempotency-Key: verify-01"
```
#### CLI
```bash
npx policygrain verify site_01...
```
## Observed verification signals
- banner_loader_request: confirmed request to cdn.policygrain.com/b/v1/loader.js
- banner_rendered: visible equal-choice banner painted in viewport
- trackers_before_choice: zero optional tracking requests or cookies before visitor action
- trackers_after_reject: zero optional tracking requests after clicking Reject
- withdraw_route: accessible control to reopen preferences after Accept
- privacy_notice_link: reachable privacy notice link on the page
---
# Cryptographic evidence ledger & exports
Every consent grant, update, and withdrawal recorded by PolicyGrain is written by an insert-only PostgreSQL role, linked in a per-site SHA-256 hash chain, and anchored daily with an Ed25519 signed Merkle root.
## Hash chain and Ed25519 daily Merkle roots
- **HMAC-SHA256 IP key**: Raw visitor IP addresses are never stored. Incoming IPs are keyed-hashed with a server-side HMAC-SHA256 secret for rate-limiting and abuse classification only.
- **Insert-only database role**: The receipt ingest writer holds only INSERT and SELECT privileges on evidence.consent_events, preventing silent mutation or deletion.
- **Per-site SHA-256 chain**: Each receipt hashes its canonical payload together with the previous sequence's hash for that site.
- **Ed25519 daily Merkle roots**: A scheduled worker computes a Merkle root over each site's daily receipts, signs the root with the server Ed25519 key, and stores it in evidence.evidence_roots.
## 10,000 monthly free-tier receipts (never blocks ingest)
Each site includes 10,000 trusted consent receipts per calendar month on the free plan. Reaching 10,000 never turns off your banner and never drops incoming receipts: every choice continues to be stored and hash-chained, while evidence packs clearly report any gated_from date past the free allowance.
Paid plans raise the export allowance and site count: Free ₹0 (1 site, 10,000 receipts a month) · Pro ₹1,499 a month or ₹14,999 a year (3 sites, 100,000 a month) · Agency ₹6,999 a month or ₹69,999 a year (25 sites, 500,000 a month) · Vendor Trust Pack ₹14,999 plus ₹2,999 a year. Prices exclude 18% GST (SAC 998314). See /reference/billing.
## Export limit-aware JSON & CSV evidence packs
CSV exports apply strict formula neutralization (prefixing leading =, +, -, @, tab, or carriage-return characters) so spreadsheet tools cannot execute injected formulas.
```bash
# Check latest daily Ed25519 Merkle root
curl https://api.policygrain.com/v1/sites/site_01.../seal \
-H "Authorization: Bearer $POLICYGRAIN_API_KEY"
# Request a date-bounded evidence pack (requires verified account + evidence:read)
curl -X POST https://api.policygrain.com/v1/sites/site_01.../evidence-packs \
-H "Authorization: Bearer $POLICYGRAIN_API_KEY" \
-H "Idempotency-Key: pack-nov-2026" \
-H "Content-Type: application/json" \
-d '{"from": "2026-11-01", "to": "2026-11-22"}'
```
---
# CheckMyDPDP 3-pass scanner & Chrome Inspector
CheckMyDPDP inspects any public webpage across three clean browser passes—before choice, banner parity, and after Reject—returning 11 concrete observations with exact network hosts, cookie names, and statutory citations.
## The 3-pass browser inspection
1. Pass 1 (Cold load): loads the URL in a clean Chromium context with no cookies and records every third-party request, cookie, localStorage write, and Google Consent Mode state before any user choice.
2. Pass 2 (Banner & Reject): inspects the banner's first-layer controls, checks for pre-ticked boxes or browse-to-consent wording, clicks Reject, and records any trackers that still fire.
3. Pass 3 (Accept, Withdraw & Notices): clicks Accept to check for a visible withdrawal route, and inspects forms, privacy notice links, and grievance contact links.
## All 11 evidence-backed checks (no scores)
Every check resolves to seen, not_seen, or couldnt_check—never a percentage or letter grade. If a bot wall or iframe prevents inspection, the result explicitly reports couldnt_check and never marks the page clean.
The 11 scanner checks in modules/scanner/openapi.json
| Check ID | Group | Statutory anchor |
| --- | --- | --- |
| trackers_before_choice | Before any choice | DPDP Act s.6(1) |
| no_banner_with_trackers | Before any choice | DPDP Act s.5(1) |
| consent_mode_granted_before_choice | Before any choice | DPDP Act s.6(1) |
| reject_harder_than_accept | The banner | DPDP Act s.6(1) |
| consent_by_continuing | The banner | DPDP Act s.6(1) |
| preticked_choices | The banner | DPDP Act s.6(1) |
| trackers_after_reject | After a choice | DPDP Act s.6(1) |
| no_withdraw_route | After a choice | DPDP Act s.6(4) |
| no_privacy_notice_link | Notices and contacts | SPDI Rules r.4(1) |
| no_notice_at_form | Notices and contacts | SPDI Rules r.5(3) |
| no_grievance_contact | Notices and contacts | DPDP Rules r.9 |
## Run from CLI, API, or Chrome MV3 Inspector
#### CLI
```bash
npx checkmydpdp https://example.in --json
```
#### cURL
```bash
curl -X POST https://api.policygrain.com/v1/scans \
-H "Content-Type: application/json" \
-d '{"url": "https://example.in"}'
```
Need to inspect a logged-in staging page behind a VPN without sending URLs to any server? Use the 100% local CheckMyDPDP Chrome MV3 Inspector (see Plugins & SDKs > Chrome MV3 Inspector).
---
# Data Principal rights, grievances & drift monitoring
DPDP readiness is ongoing: handle Data Principal access, correction, erasure, and grievance requests within Rule 14 timelines, and catch third-party tracker regressions as your site ships new code.
## Data Principal rights & Rule 14 grievance intake (DPDP ss.11–14)
- **Right to access (s.11)**: Provide a summary of personal data processed, processing activities, and identities of Data Processors with whom data has been shared.
- **Correction & erasure (s.12)**: Correct inaccurate data and erase personal data no longer necessary for the specified purpose once consent is withdrawn.
- **Grievance redressal (s.13 & Rule 14)**: Publish your Grievance Officer / DPO contact clearly (generated in rights-grievance) and track responses within the statutory Rule 14 response window (up to 90 days).
- **Nomination (s.14)**: Allow individuals to nominate another person to exercise rights in the event of death or incapacity.
## Scheduled drift monitoring ('Changes Since Last Scan')
Marketing pixels and GTM tags often get added weeks after an initial consent setup. Comparing each scheduled CheckMyDPDP scan or CI run (npx checkmydpdp --json) against the prior baseline immediately flags newly introduced trackers firing before choice, broken Reject buttons, or missing privacy notice links.
```bash
# Example CI regression check against staging
npx checkmydpdp https://staging.example.in --json > scan-latest.json
```
---
# Ecosystem plugins & frameworks
Deploy Consent Banner v2 and inspect live pages directly inside your existing stack with five first-party MIT open-source packages.
## All 5 shipped integrations
First-party PolicyGrain ecosystem packages
| Package | Platform | Key capabilities |
| --- | --- | --- |
| clients/gtm-template | Google Tag Manager | All 7 Google Consent Mode v2 signals, regional defaults, sync returning-visitor restore, live policygrain:choice bridge |
| clients/wordpress-plugin | WordPress (PHP 8+) | WP Consent API bridge, WooCommerce checkout notice, [policygrain_notice] and [policygrain_grievance] shortcodes |
| clients/shopify-extension | Shopify | Theme App Extension block + Shopify Customer Privacy API bridge |
| @policygrain/react | React 18/19 & Next.js | Server Component , PolicyGrainProvider, usePolicyGrainConsent, PolicyGrainGate |
| clients/chrome-extension | Chrome (Manifest V3) | 100% local tab inspector, zero telemetry, India-first 30-vendor fingerprint table |
---
# Google Tag Manager Community Template
The official PolicyGrain GTM Community Template (clients/gtm-template) sets Consent Mode v2 defaults on Consent Initialization before any tag fires and syncs live choices from Consent Banner v2.
## Capabilities
- All 7 Google Consent Mode v2 signals: ad_storage, analytics_storage, ad_user_data, ad_personalization, functionality_storage, personalization_storage, and security_storage.
- Regional scope defaults: India (IN, DPDP Act 2023 default), EEA + UK + Switzerland, global (ALL), or custom ISO 3166 region codes.
- Tag controls: wait_for_update, ads_data_redaction, and url_passthrough via gtagSet.
- Synchronous returning-visitor restore: reads the first-party pg_consent cookie (or pg::choice fallback) during Consent Initialization and ignores receipts older than material_version.
## Install in Google Tag Manager
1. Open your Web container in Google Tag Manager and go to Templates > Tag Templates > New.
2. Choose Import from the menu and select clients/gtm-template/template.tpl.
3. Save the template and create a new tag using PolicyGrain DPDP Consent Banner.
4. Enter your PolicyGrain Site Key, choose your region scope (default IN), and attach the trigger Consent Initialization — All Pages.
5. Preview with Tag Assistant to confirm default denied states fire before GA4 or Ads tags, then publish.
---
# WordPress Plugin (PHP 8+)
Built for PHP 8+ WordPress and WooCommerce sites, clients/wordpress-plugin injects Consent Banner v2 in wp_head, bridges choices into the WP Consent API, and embeds hosted DPDP notices via shortcodes.
## Installation & settings
1. Package or upload clients/wordpress-plugin/policygrain-dpdp into wp-content/plugins/.
2. Activate PolicyGrain DPDP Consent & Notices in WordPress Admin > Plugins.
3. Open Settings > PolicyGrain DPDP and enter your Site Key. Optionally set your hosted notice URL, your grievance or rights page URL, and whether to show the notice on WooCommerce checkout. The CDN host and API origin default to https://cdn.policygrain.com and https://api.policygrain.com.
4. Nothing loads on the front end until a Site Key is saved. The plugin then adds