Access Mode
Access mode lets your end users view the details of a work registered on the Allfeat blockchain. No modification is made — it’s read-only.
Use Cases
Section titled “Use Cases”- Post-registration confirmation — let users verify their work’s on-chain status
- Work lookup — display work details on a dedicated page of your platform
- Support & verification — allow customer support to quickly check a work’s status
Set mode="access" on the widget:
<ats-widget id="ats-widget" site-key="cpk_your_public_key" ats-url="https://ats.api.allfeat.org" network="testnet" mode="access"></ats-widget>Backend Token Setup
Section titled “Backend Token Setup”The JWT token must be created with action_type: "access":
app.post('/api/ats-token/access', async (req, res) => { const response = await fetch('https://ats.api.allfeat.org/v1/sessions', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Origin': 'https://yoursite.com', // domain where the widget is embedded }, body: JSON.stringify({ secret_key: process.env.ALLFEAT_SECRET_KEY, action_type: 'access', allowed_network: 'testnet', }), });
const { token } = await response.json(); res.json({ token });});User Flow
Section titled “User Flow”- The user enters the work’s access code (
atc_...) - The widget validates the code and fetches work details from the API
- A summary screen is displayed with:
| Field | Description |
|---|---|
| ATS ID | Unique on-chain identifier |
| Title | Work title |
| Network | Blockchain network (testnet/mainnet) |
| Owner | Blockchain address of the work’s owner |
| Version | Latest version number |
| Commitment | Cryptographic commitment hash |
| Created at | Registration timestamp |
Events
Section titled “Events”Access mode emits a simplified event lifecycle:
ready → completeThe allfeat:complete event in access mode has empty blockchain fields since no transaction is performed:
{ atsId: number | null; txHash: ''; // No transaction in access mode blockNumber: 0; explorerUrl: ''; accessCode: string; // The access code that was entered}Example: Pre-filled Access Code
Section titled “Example: Pre-filled Access Code”If your platform already knows the access code (e.g., stored in your database), you can guide the user directly:
const widget = document.getElementById('ats-widget');
// Set up the widget in access modewidget.setAttribute('mode', 'access');
// Listen for completionwidget.addEventListener('allfeat:complete', (e) => { console.log('Work details retrieved:', e.detail);});
// Initialize with tokenconst { token } = await fetch('/api/ats-token/access', { method: 'POST',}).then(r => r.json());widget.setToken(token);