Would you like to use your own viewer? Integrate into a native application? Use Darkblock to store programmatic data like javascript, json, and anything else you can imagine? You can integrate with the protocol more directly and control what happens with the unlockable data.
Once Darkblock unlockable content is detected we need to construct a session token to access the content. This token is formed by creating a specific message, the 'msgParams', which includes the current epoch timestamp in milliseconds and the user's wallet address. The wallet signs this message, producing a signature. The session token is thus a combination of this signature, the timestamp, and the chain identifier of the blockchain network in use.
msgParams = `You are unlocking content via the Darkblock Protocol.\n\nPlease sign to authenticate.\n\nThis request will not trigger a blockchain transaction or cost any fee.\n\nAuthentication Token: ${data}`;
break;
case SIGNING_TYPE.upgradeNft:
msgParams = `You are interacting with the Darkblock Protocol.\n\nPlease sign to upgrade this NFT.\n\nThis request will not trigger a blockchain transaction or cost any fee.\n\nAuthentication Token: ${data}`;
break;
case SIGNING_TYPE.upgradeCollection:
msgParams = `You are interacting with the Darkblock Protocol.\n\nAttention: You are attempting to upgrade an entire NFT collection!\n\nPlease sign to continue.\n\nThis request will not trigger a blockchain transaction or cost any fee.\nAuthentication Token: ${data}`;
break;
default:
msgParams = `You are unlocking content via the Darkblock Protocol.\n\nPlease sign to authenticate.\n\nThis request will not trigger a blockchain transaction or cost any fee.\n\nAuthentication Token: ${data}`;
One session token is needed per chain, and can be cached, as they do not currently expire. They will be prone to expiration in the future, the rules around this will be coming soon based on partner feedback.
Here is the format of the session token: <EPOCH>_<SIGNATURE>_<PLATFORM>
The ArtId can be taken from the Darkblock info response and combined with the session token, owner wallet address, NFT Contract and Token Id, and platform to construct a Gateway request.
For Ethereum compatible chains you can use this handy-dandy signature tool that allows you to paste in some arbitrary text and create a signature with Metamask: