Create your first topic

1. Setup your notifyz topic

Once you have register to notifyz and choose the plan that fits your needs, go to the topic section and create a new topic.

create topic

  1. Once you topic is ready, create a "Subscription link" and share it with the devices you want to receive notifications.

topic link

  1. Share the link with the devices you want to receive notifications, then subscribe to the topic.

topic subscription

  1. Once you have subscribed to the topic, you can start sending notifications to your devices.

You can grab a code example in the "Integrate" section within the topic page.

Here a simple code example to send a notification to a topic:

1const response = await fetch("https://api.notifyz.dev/topics/:topicId/notify", {
2	headers: {
3		"Content-Type": "application/json",
4		"X-Api-Key": "API_KEY"
5	},
6	method: "POST",
7	body: JSON.stringify({
8		title: "Hello world",
9		body: "This is a test message",
10		imageURL: "https://placehold.co/100x100",
11		redirectURL: "https://notifyz.dev",
12	})
13});
14
15if (response.ok) {
16	console.log("Event sent successfully");
17} else {
18	console.error("Failed to send event -> ", response.statusText);
19}