npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

make-traffic-integration-core

v0.3.7

Published

Core Library for Make Traffic task manager

Readme

make-traffic-integration-core

Framework-agnostic TypeScript library for managing tasks in a traffic exchange system.

npm

Installation

npm install make-traffic-integration-core

Quick Start

import { NewTaskManager, Events } from "make-traffic-integration-core";

const manager = await NewTaskManager({
    apiUrl: "https://integration.maketraffic.io",
    appKey: "YOUR_APP_KEY",
});

const { data: tasks } = await manager.getTasks("user-123");
tasks.forEach(task => console.log(task.name));

manager.subscribe(Events.TaskClaimSucceed, (task) => {
    console.log("Claimed:", task.name, task.rewards);
});

API

NewTaskManager(config)Promise<TaskManagerApp>

Preferred initialiser. Creates an instance, loads plugin scripts, and stores it on window.globalTaskManager.

const manager = await NewTaskManager({ apiUrl, appKey });

For advanced use you can also instantiate manually: new TaskManagerApp(config) + await manager.init().


getTasks(userID, filters?)Promise<TasksList>

Fetches the task list for a user. TasksList is a paginated object — use .data for the array of tasks.

const { data: tasks, total } = await manager.getTasks("user-123", {
    isActive: true,
    categories: ["default"],
    pluginIds: [2, 4],
    authProvider: "telegram",
});

TaskFilters

| Field | Type | Description | |-------|------|-------------| | isActive | boolean \| "all" | Filter active tasks (default: all) | | entityType | "task" \| "deal" \| "all" | Entity type filter | | pluginIds | number[] | Specific plugin IDs | | categories | string[] | Category slugs | | page | number | Page number | | pageSize | number | Items per page | | authProvider | string | Auth provider (e.g. "telegram") |


goProcess(userID, task, options?)Promise<void>

Triggers the task's go/start action (e.g. opens a redirect). Emits Events.ClickOnTaskGo.

await manager.goProcess("user-123", task, { authProvider: "telegram" });

claimProcess(userID, task, options?)Promise<void>

Claims the reward. On success emits Events.TaskClaimSucceed. On failure throws HttpError with a human-readable message parsed from the server response body.

try {
    await manager.claimProcess("user-123", task, { authProvider: "telegram" });
} catch (err) {
    if (err instanceof HttpError) {
        console.error(err.message); // e.g. "task has not been completed"
    }
}

subscribe(event, callback) / unsubscribe(event, callback)

Event pub/sub. Always unsubscribe in cleanup to avoid memory leaks.

const handler = (task) => console.log("Claimed:", task);
manager.subscribe(Events.TaskClaimSucceed, handler);

// cleanup
manager.unsubscribe(Events.TaskClaimSucceed, handler);

Events

| Event | Payload | When | |-------|---------|------| | Events.TaskClaimSucceed | Task | Reward successfully claimed | | Events.TaskClaimFailed | Task | Claim rejected (e.g. task not completed) | | Events.ClickOnTaskGo | Task | Go action triggered | | Events.ClickOnTaskClaim | Task | Claim action triggered | | Events.ClaimModalOpen | ClaimModalOpenPayload | Plugin needs a UI container | | Events.ClaimModalClosed | ClaimModalClosedPayload | Modal dismissed |


Types

import {
    Task,
    TasksList,
    TaskFilters,
    EntityType,
    HttpError,
    Events,
} from "make-traffic-integration-core";

Examples

| Example | Stack | Link | |---------|-------|------| | Vanilla JS | No build step | examples/native-js | | Vanilla TS | tsc, ESNext modules | examples/native-ts | | React | React 18, Tailwind | examples/react-app |


License

MIT