npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@toniq-labs/toniq-nft-frame

v3.1.0

Published

Easy to use and secure iframes for displaying inscriptions of many different types.

Downloads

88

Readme

toniq-nft-frame

Easy to use and secure iframes for displaying inscriptions of many different types.

  • npm package: https://www.npmjs.com/package/@toniq-labs/toniq-nft-frame
  • demo: https://toniq-nft-frame-demo.netlify.app
  • source code: https://github.com/Toniq-Labs/toniq-nft-frame

How it works and how to use it

There are two main parts here:

  • the custom web element: <toniq-nft-frame>
    • This element is published on npm here: https://www.npmjs.com/package/@toniq-labs/toniq-nft-frame
    • It can be used by installing it: npm i @toniq-labs/toniq-nft-frame, and then importing it's main script somewhere in your run-time, and then placing it in your DOM with toniq-nft-frame.
    • You'll need to pass properties to this element using Javascript properties on the element instance. All the properties are listed in the types exported by nft-config.ts.
    • Host the iframe code mentioned below on a separate domain, and pass the path to the iframe code in to this custom element to the childFrameUrl property.
  • the iframe code
    • The iframe code is produced by the npm run build command and is then located at packages/toniq-nft-frame/iframe-dist within this repo.
    • This code will need to be hosted on a domain separate from your main website, but on the same domain as all the NFTs / images that it will be loading.

Content Security Policies

These have been tested to work:

  • parent domain: default-src <the domain of your hosted iframe> 'unsafe-inline' 'self' blob: data:
  • iframe domain: default-src 'unsafe-inline' 'self' blob: data:

iframes

To display HTML ordinals, such as those generated by this BitGen standard, on your website, you must load the inscription inside an iframe. For security purposes, make sure to host your iframe code on another domain or sub-domain than your frontend to prevent inscription code from hijacking your website.

This, combined with iframe sizing difficulties, can make displaying ordinals a daunting task. However, Toniq Labs has created toniq-nft-frame to smooth out the process. Check it out here: https://github.com/Toniq-Labs/toniq-nft-frame.