Skip to content

Repository files navigation

@pryvc/sdk

The PRYVC embed: the Share with PRYVC button (one-click consented form fill) and the certified consent widget (accountless, tamper-evident consent certificates). Zero dependencies, < 5 KB gzipped.

Most sites should use the CDN channel — updates reach you automatically:

<script
  src="https://cdn.pryvc.com/v1/pryvc.js"
  data-client-id="pc_your_client_id"
  data-fields="first_name,last_name,email"
  data-purpose="Quote request"
></script>

Via npm (bundled apps):

import '@pryvc/sdk'; // side-effect: exposes window.Pryvc (and boots any declarative script tag)

window.Pryvc.init({
  clientId: 'pc_your_client_id',
  fields: ['first_name', 'email'],
  purpose: 'Quote request',
  container: document.querySelector('#slot'),
});
  • Popups blocked (iOS Safari, in-app webviews)? The SDK falls back to a full-page redirect automatically and resumes on return.
  • Button styles: data-style="dark pill lg" — see the gallery at demo.pryvc.com/styles.
  • Certified consent (Enterprise): data-mode="consent" — every submission becomes a verifiable certificate.

Full documentation: developers.pryvc.com · Get a client id: portal.pryvc.com

Why this is open source

This script runs on your pages and touches your visitors' contact details. Asking you to embed a black box would sit badly with a product whose entire argument is that evidence should be verifiable without trusting the vendor.

It is also already public in every practical sense — published to npm and served unminified from a CDN — so closing the source bought obscurity, not security.

What you can check here:

  • The consent widget is fail-open: if capture fails for any reason, your form still submits (src/consent.ts). An evidence problem is never allowed to become a conversion problem.
  • Values are posted to the PRYVC API and nowhere else — no analytics, no third-party beacons, no dependencies at all (package.json has zero runtime deps).
  • Field detection is local and inspectable (src/fieldMap.ts).
  • Device details collected at submission are standard navigator/screen properties, enumerated in src/device.ts — no canvas or audio fingerprinting.

Protocol contracts

The embed implements the Share Protocol (SP/1) embed contract. The protocol names are vendor-neutral, so a page written against them works with any conforming hub:

Contract Protocol name Legacy alias also emitted
Hidden input sp1_cert_id pryvc_cert_id
Success event sp1:consent pryvc:consent
Failure event sp1:consent-error pryvc:consent-error
Field attribute data-sp1-field data-pryvc-field

Listen for sp1:consent and read sp1_cert_id and switching hubs is a script-src change. The aliases exist only for integrations written before the contract was neutralized.

Build

npm install
npm run build      # esbuild -> dist/, then tsc for type declarations

Reporting a security issue

Please email security@pryvc.com rather than opening a public issue.

License

Apache-2.0.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages