import { NeynarAPIClient,Configuration } from "@neynar/nodejs-sdk";
// make sure to set your NEYNAR_API_KEY .env
// don't have an API key yet? get one at neynar.com
const config = new Configuration({
apiKey:process.env.NEYNAR_API_KEY,
});
if (!process.env.NEYNAR_API_KEY) {
throw new Error("NEYNAR_API_KEY is not set");
}
const client = new NeynarAPIClient(config);
const webhook = await client.publishWebhook({
name:"abc",
url:"YOUR_NGROK_URL_HERE",
subscription: {
"cast.created": {
text: "\\$(DEGEN|degen)",
},
},
}
);
console.log(webhook);