@tnfdev/js
v1.0.5
Published
## Usage
Readme
@tnfdev/js
Usage
To use @tnfdev/js, you can import it in your JavaScript or TypeScript files. Here's a simple example:
Initialize the client:
import { TeknifyClient } from '@tnfdev/js'; const client = new TeknifyClient({ applicationId: '<your-application-id>', subscriberId: '<user-subscriber-id>', });Get all notifications:
const notifications = await client.notifications.getNotifications(); console.log(notifications);Mark a notification as read:
const notificationId = '<notification-id>'; await client.notifications.markAsRead(notificationId); console.log(`Notification ${notificationId} marked as read.`);Listen for new notifications:
client.notifications.on((notifications) => { notifications.forEach((notification) => { console.log('New notification:', notification); }); });
