@wdft/gvm-sdk
v0.1.3
Published
get via msg sdk - gvm.js
Readme
gvm.js
WDFT - We Do Fintech
GetViaMsg SDK and WebComponents
Showcase of gvm.js web-component
Entrypoints / modes
The package ships three integration layers — pick the one that fits, they don't interfere with each other:
| Entrypoint | Mode | Use it when |
| --- | --- | --- |
| @wdft/gvm-sdk (npm) | raw SDK — programmatic getViaMsg(), no DOM | you build your own UI and control everything |
| dist/gvm.js | declarative — auto-init, reads data-gvm-* + inline <template> | you hand-write the paywall markup |
| dist/gvm-overlay.js | config-driven — fetches a JSON config, injects data-gvm-*, boots gvm.js | you want a zero-config, centrally-managed paywall |
gvm.jsandgvm-overlay.jsare isolated ES modules served from a CDN (or bundled).- Loading
gvm-overlay.js(instead ofgvm.js) is the overlay signal — no flag needed; config and admin-editor URLs are derived fromdata-gvm-env+data-gvm-tenant(see gvm-overlay docs). - The admin editor (
gvm-admin.js) is loaded lazily on?gvm_admin=1bygvm-overlay.jsonly.
Custom API endpoint
Beside data-gvm-env (demo|local|dev|qa|prod), you can point at an arbitrary
API URL with data-gvm-endpoint (absolute URL). When set, the real
environment is used regardless of data-gvm-env.
<body data-gvm data-gvm-env="demo" data-gvm-endpoint="https://api.example.com" ...>gvm-overlay.js (config-driven layer)
gvm-overlay.js is a zero-config layer on top of gvm.js: it fetches a JSON config and
applies prices/paywalls to content marked with data-gvm-reference. Loading gvm-overlay.js
(instead of gvm.js) is the overlay signal — integration is a one-liner, with the attributes
on the <script> tag:
<script type="module"
src="https://esm.sh/@wdft/gvm-sdk@latest/gvm-overlay.js"
data-gvm-tenant="your_tenant"
data-gvm-env="dev"></script>
<div data-gvm-reference="my-article">…paywalled content…</div>data-gvm-config, data-gvm-admin-src and data-gvm-admin-api are optional overrides.
Templates (paywall + payment) come from the config (templates.paywall / templates.payment) —
the overlay ships no built-in markup.
Docs: gvm-overlay. Backend/admin editor: gvm-sdk-admin.
Changelog
See changelog
More & Contact
Read more about our service GetViaMsg at https://getviamsg.com
