@policystack/vue
v1.0.1
Published
Vue components for PolicyStack
Downloads
257
Readme
@policystack/vue
Vue components for rendering PolicyStack documents at runtime.
@policystack/vue provides headless Vue components that compile and render policies directly from config.
Install
bun add @policystack/vue @policystack/sdkUsage
// policystack.ts
import { ContractPrerequisite, defineConfig, LegalBases } from "@policystack/sdk";
export default defineConfig({
company: {
name: "Acme Inc.",
legalName: "Acme Corporation",
address: "123 Main St, Springfield, USA",
contact: { email: "[email protected]" },
},
effectiveDate: "2026-01-01",
jurisdictions: ["eu", "us-ca"],
data: {
collected: { "Account Information": ["Email", "Name"] },
context: {
"Account Information": {
purpose: "To create and manage user accounts",
lawfulBasis: LegalBases.Contract,
retention: "Until account deletion",
provision: ContractPrerequisite("We cannot create or operate your account."),
},
},
},
cookies: {
used: { essential: true, analytics: false, marketing: false },
context: {
essential: { lawfulBasis: LegalBases.LegalObligation },
analytics: { lawfulBasis: LegalBases.Consent },
marketing: { lawfulBasis: LegalBases.Consent },
},
},
thirdParties: [],
});// App.ts
import policystack from "./policystack";
import { PolicyStack, PrivacyPolicy } from "@policystack/vue";
export default {
components: { PolicyStack, PrivacyPolicy },
template: `
<PolicyStack :config="policystack">
<PrivacyPolicy />
</PolicyStack>
`,
data() {
return { policystack };
},
};Exports
PolicyStackPrivacyPolicyCookiePolicyrenderDocument
