Vanilla JS
Initialize
<script type="module">
import { tiun } from 'https://unpkg.com/@tiun/sdk/tiun.js';
tiun.init({
snippetId: 'YOUR_SNIPPET_ID',
language: 'en', // set to your site's language
});
</script>Checkout
<button id="btn-checkout">Subscribe</button>
<script type="module">
import { tiun } from 'https://unpkg.com/@tiun/sdk/tiun.js';
tiun.init({ snippetId: 'YOUR_SNIPPET_ID', language: 'en' });
document.getElementById('btn-checkout').onclick = () => {
tiun.checkout({ productId: 'YOUR_PRODUCT_ID' });
};
</script>Listen for user changes
Login and logout
Gate content
Read properties
Paywall events (time-based)
Last updated
Was this helpful?