Prerequisite You need to have made an account on Dingify and have your API key ready.

Create a channel

Channels are containers for events. Use one for payments, another for logins, etc.

On the Dashboard you can click create new channel and name it new-payment

Pro-tip: Keep your channel name simple

Install SDK

To get the most out of this guide, you’ll need to:

1. Install

Get your Dingify SDK.

2. Send your first notification

Get your Dingify SDK.

page.tsx
import { Dingify } from "dingify";

const dingify = new Dingify({
    apiKey: "<YOUR_API_KEY_HERE>",
});

  const result = await dingify.events.create({
    name: "asd",
    channel: "new-channel-name",
    icon: "🎉",
    userId: "user-123",
    notify: true,
    tags: {
      plan: "premium",
      cycle: "monthly",
    },
  });

  // Handle the result
  console.log(result);
}

Try it yourself

Now that you have everything, you can track your first event. You can do this by making a POST request to the API or by using the SDK.

After making the request you will see the event tracked at Dingify dashboard. It will be under the channel you created.