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

@taskon/core

v0.0.1-beta.1

Published

TaskOn Core Library

Downloads

199

Readme

@taskon/core

TaskOn Core Library - Client and API modules for TaskOn Widget.

Installation

npm install @taskon/core
# or
pnpm add @taskon/core
# or
yarn add @taskon/core

Quick Start

import { createTaskOnClient, createUserApi } from '@taskon/core';

// 1. Create client
const client = createTaskOnClient({
  apiKey: 'your-api-key',
});

// 2. User login
const user = createUserApi(client);
const { token, is_new_user } = await user.loginWithEmail({
  sns_id: '[email protected]',
  sign: 'signature',
  timestamp: Date.now(),
});

// 3. Set user token
client.setUserToken(token);

// 4. Get user info
const info = await user.getInfo();

API Reference

createTaskOnClient(config)

Create a TaskOn client instance.

import { createTaskOnClient } from '@taskon/core';

const client = createTaskOnClient({
  apiKey: 'your-api-key',       // required - API Key for authentication (X-API-Key header)
  baseURL: 'https://custom-api.example.com', // optional, default: https://white-label-api.taskon.xyz
  timeout: 30000, // optional, default: 30000ms
});

Config Options

| Option | Type | Required | Description | |--------|------|----------|-------------| | apiKey | string | ✓ | API Key for authentication (X-API-Key header) | | baseURL | string | | API base URL | | timeout | number | | Request timeout in ms |

Client Properties & Methods

| Property/Method | Description | |-----------------|-------------| | setUserToken(token) | Set user token (C-side user authorization) | | getUserToken() | Get current user token | | request(options) | Make a POST request |

HTTP Headers

X-API-Key: xxx             # B-side project authorization
Authorization: Bearer xxx  # C-side user authorization

createUserApi(client)

Create user API module for user authentication.

import { createTaskOnClient, createUserApi, ApiError } from '@taskon/core';

const client = createTaskOnClient({
  apiKey: 'your-api-key',
});

const user = createUserApi(client);

Login Methods

Email Login

const { token, is_new_user } = await user.loginWithEmail({
  sns_id: '[email protected]',      // Email address
  sign: 'signature',               // Signature
  timestamp: Date.now(),           // Timestamp
  sns_type: 'Email',               // Optional, defaults to 'Email'
  user_name: 'username',           // Optional
  join_invite_code: 'invite-code', // Optional
});
client.setUserToken(token);

EVM Wallet Login

const { token, is_new_user } = await user.loginWithEvm({
  address: '0x...',                // Wallet address
  sign: '0x...',                   // Signature
  timestamp: Date.now(),           // Timestamp
  chain: 'evm',                    // Optional, defaults to 'evm'
  user_name: 'username',           // Optional
  join_invite_code: 'invite-code', // Optional
});
client.setUserToken(token);

Solana Wallet Login

const { token, is_new_user } = await user.loginWithSolana({
  login_request: {
    address: '...',                // Wallet address
    nonce: '...',                  // Challenge nonce
    sig: '...',                    // Signature
    chain_type: 'solana',          // Chain type
    pubkey: '...',                 // Optional public key
    domain: '...',                 // Optional domain
    timestamp: Date.now(),         // Optional timestamp
  },
  invite_code: 'invite-code',      // Optional
});
client.setUserToken(token);

SNS Login (Twitter, Discord, Telegram, etc.)

const { token, is_new_user } = await user.loginWithSns({
  type: 'Twitter',                 // SNS type
  token: 'oauth-access-token',     // OAuth token
  invite_code: 'invite-code',      // Optional
  verify_code: '123456',           // Optional (for email)
  tg_data: { ... },                // Optional (for Telegram)
});
client.setUserToken(token);

Other Methods

| Method | Returns | Description | |--------|---------|-------------| | getInfo() | Promise<UserInfo> | Get current user info |


ApiError

Custom error class for API errors.

import { ApiError } from '@taskon/core';

try {
  await user.loginWithEmail({
    sns_id: '[email protected]',
    sign: 'signature',
    timestamp: Date.now(),
  });
} catch (err) {
  if (err instanceof ApiError) {
    console.log(err.code);    // Error code, e.g., 'INVALID_EMAIL'
    console.log(err.message); // Error message
    console.log(err.data);    // Additional error data
  }
}

Types

// Client
export type {
  TaskOnClientConfig,
  RequestOptions,
  TaskOnClient,
  TaskOnResponse,
} from '@taskon/core';

// User
export type {
  UserApi,
  UserInfo,
  LoginResult,
  EmailLoginParams,
  EvmLoginParams,
  SolanaLoginParams,
  SnsLoginParams,
  ChainType,
  AddressLoginRequest,
  TgData,
} from '@taskon/core';

TypeScript Support

This package is written in TypeScript with full type definitions included.

Browser and Node.js Support

  • Node.js: >= 18.0.0
  • Browser: Modern browsers (ES2020+)

License

MIT