
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
token-gating
Advanced tools
How to get started:
React project:
run to install the package and all neccessary node modules:
npm i token-gating @thirdweb-dev/react @thirdweb-dev/sdk @vitejs/plugin-react
or for yarn
yarn add token-gating @thirdweb-dev/react @thirdweb-dev/sdk @vitejs/plugin-react
add the thirdweb provider to your main.js or index.js file and set the desired Chain ID:
import { ThirdwebProvider, ChainId } from "@thirdweb-dev/react"
// Add the chain ID of the chain your gating contract is on`
const activeChainId = ChainId.Goerli
<React.StrictMode>
<ThirdwebProvider activeChain={activeChainId}>
<App />
</ThirdwebProvider>
</React.StrictMode>
if you use Vite you also need to add the following to your vite.config.js:
import { defineConfig } from "vite"
import react from "@vitejs/plugin-react-swc"
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
define: {
global: "globalThis",
"process.env": {},
},
})
import the connect buttton component into your App.js file
import TokenGatingBot from "token-gating"
add an state Variable "access":
import { useState } from "react"
const [access, setAccess] = useState(false)
use the gating component on top of your app:
<TokenGatingBot
contractAddress= //Address of the gating contract here
alchemyAPIkey=// your alchemy AIP Key here
setAccess={(newAccess) => setAccess(newAccess)}
/>
Gater the contetn you want to gate buy using
{
access && <div>Your gated content here</div>
}
FAQs
Easy way to implement token gating on your website
The npm package token-gating receives a total of 0 weekly downloads. As such, token-gating popularity was classified as not popular.
We found that token-gating demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.