👷
Custom Experience API
Legitimate allows agencies and developers to override the built-in user experience on the LGT Tap app in its entirety for a given set of tags. An external script can be loaded that can generate an entirely custom set of user interface and content.
A custom div element is provided within the Tap by Legitimate HTML markup outside of the React root element used by the existing Tap interface.
<div id="lgt-custom-experience">
This custom experience element and its children do not have any styles applied.
Legitimate provides a global
LGT
object accessible to the custom script for NFT related data.window.LGT = {
nft: {
chainId: number;
contractAddress: string;
isLocked?: boolean;
metadata?: any;
ownerAddress?: string | undefined;
tokenId: string;
},
jsonRpcUrl: string;
}
This object will be available when the custom script tag loads because the NFT information is loaded from LGT's servers at the same time as the custom script information.
In the case of an unsuccessful verification, Legitimate's servers will not return any NFT information.
A JavaScript file can be injected into the page via a configurable Custom Experience script tag that is added to the page header. The tag can be configured to be injected during initialization or when the NFT is claimed and the experience is activated.
The Custom Experience script tag manages the lifecycle of the JavaScript injected such that
Custom HTML tags can be added as a block in builder.io. The tags can include CSS, JavaScript, and any HTML compliant markup. Because the tag is added to the builder.io content, it can only be used to add tags to the body of the exclusive tokengated content.
Last modified 29d ago