Skip to content

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.

  • 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>

The JWT token must be created with action_type: "access":

backend/routes/ats-token.ts
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 });
});
  1. The user enters the work’s access code (atc_...)
  2. The widget validates the code and fetches work details from the API
  3. A summary screen is displayed with:
FieldDescription
ATS IDUnique on-chain identifier
TitleWork title
NetworkBlockchain network (testnet/mainnet)
OwnerBlockchain address of the work’s owner
VersionLatest version number
CommitmentCryptographic commitment hash
Created atRegistration timestamp

Access mode emits a simplified event lifecycle:

ready → complete

The 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
}

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 mode
widget.setAttribute('mode', 'access');
// Listen for completion
widget.addEventListener('allfeat:complete', (e) => {
console.log('Work details retrieved:', e.detail);
});
// Initialize with token
const { token } = await fetch('/api/ats-token/access', {
method: 'POST',
}).then(r => r.json());
widget.setToken(token);