01
Exports
| Export | Kind | Use |
|---|---|---|
PactProvider | Component | Connect context and optionally install bootstrap |
PactBootstrap | Component | Render exact inline bootstrap |
PactGate | Component | Render children only when a purpose is true |
PactPreferencesButton | Component | Open managed or headless preferences |
usePact() | Hook | Read state and actions |
usePactPurpose(purpose) | Hook | Read one boolean decision |
PACT_BOOTSTRAP | Constant | Server-document integration |
02
Context value
typescript
interface PactContextValue {
isReady: boolean
isOpen: boolean
decided: boolean
gpc: boolean
region: string
purposes: PurposeDecisions
error: Error | null
accept(purposes?: Purpose[]): Promise<void>
reject(purposes?: Purpose[]): Promise<void>
save(purposes: PurposeDecisions): Promise<void>
openPreferences(): void
closePreferences(): void
}