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

codatta-frontier-sdk

v0.1.10

Published

Codatta Frontier SDK - API client for Codatta Frontier platform

Downloads

95

Readme

Codatta Frontier SDK

API client SDK for the Codatta Frontier platform.

Installation

npm install codatta-frontier-sdk

Note: axios is a peerDependency. Make sure axios >= 1.0.0 is installed in your project.

Usage

import { FrontierSDK } from 'codatta-frontier-sdk'

const sdk = new FrontierSDK()

// Get task detail
const taskDetail = await sdk.getTaskDetail('task-id')

// Get task list
const taskList = await sdk.getTaskList({
  frontier_id: 'frontier-id',
  page_num: 1,
  page_size: 10
})

// Submit a task
const result = await sdk.submitTask('task-id', { field: 'value' })

// Get submission list
const submissions = await sdk.getSubmissionList({
  page_num: 1,
  page_size: 10,
  frontier_id: 'frontier-id'
})

// Get Frontier info
const frontierInfo = await sdk.getFrontierInfo('frontier-id')

// Get submission detail
const submissionDetail = await sdk.getSubmissionDetail('submission-id')

// Upload a file (with optional progress callback)
const uploadResult = await sdk.uploadFile(file, (event) => {
  console.log(`Upload progress: ${Math.round((event.loaded * 100) / (event.total ?? 1))}%`)
})

// Get a single spec task info
const specTask = await sdk.getSpecTaskInfo('task-id')

// Get multiple spec tasks info at once (comma-separated IDs)
const specTasks = await sdk.getSpecTaskInfos('task-id-1,task-id-2,task-id-3')

// Submit a spec task (status: 1 = reject, 2 = accept)
const specResult = await sdk.submitSpecTask('task-id', 'optional content', 2)

// Request a verification code sent to an email
const code = await sdk.getVerificationCode({ email: '[email protected]' })

// Verify email against a task requirement
const check = await sdk.checkEmail({
  email: '[email protected]',
  code: '123456',
  task_id: 'task-id'
})
if (check.flag) {
  console.log('Email verified successfully')
} else {
  console.warn('Verification failed:', check.info)
}

API

new FrontierSDK()

Creates an SDK instance. No parameters required — the SDK handles the following automatically:

  • Token: Retrieved from cookie (auth) or localStorage (auth)

Methods

| Method | Description | |--------|------------| | getTaskDetail(taskId) | Get task detail | | submitTask(taskId, data) | Submit task data | | getTaskList(params) | Get paginated task list | | getSubmissionList(params) | Get paginated submission list | | getFrontierInfo(frontierId) | Get Frontier detail | | getSubmissionDetail(submissionId) | Get submission detail | | uploadFile(file, onProgress?) | Upload a file | | getSpecTaskInfo(taskId) | Get single spec task info | | getSpecTaskInfos(taskIds) | Get multiple spec tasks info | | submitSpecTask(taskId, content?, status?) | Submit or update a spec task | | getVerificationCode(params) | Request a verification code | | checkEmail(params) | Verify email against a task requirement |

Method Details

getTaskList(params)

| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | frontier_id | string | Yes | The frontier to query tasks for | | page_num | number | Yes | Page number (1-based) | | page_size | number | Yes | Number of tasks per page | | task_types | string | No | Comma-separated task type filter (e.g. 'submission,validation') |

getSubmissionList(params)

| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | page_num | number | Yes | Page number (1-based) | | page_size | number | Yes | Number of items per page | | frontier_id | string | No | Filter by frontier ID | | task_ids | string | No | Comma-separated list of task IDs to filter by |

submitSpecTask(taskId, content?, status?)

| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | taskId | string | Yes | Unique task ID | | content | string | No | Optional freeform content to attach | | status | 1 \| 2 | No | 1 = reject, 2 = accept (default 2) |

getVerificationCode(params)

| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | account_type | string | No | Account type: 'email' (default) | 'block_chain' | | email | string | No | Target email address. Required when account_type is 'email' | | opt | string | No | Operation type: 'verify' (default) | 'vivolight' |

Returns the verification code string. Pass it to checkEmail to complete verification.

checkEmail(params)

| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | email | string | Yes | Email address to verify | | code | string | Yes | Verification code from getVerificationCode | | task_id | string | Yes | The task ID requiring email verification |

Returns { flag: boolean; info: string }flag: true if verification passed; flag: false with a reason in info otherwise.

Types

Key types exported from codatta-frontier-sdk:

| Type | Description | |------|-------------| | Response<T> | Standard API response wrapper | | PaginationResponse<T> | Paginated response wrapper | | TPagination | Common pagination parameters (page_num, page_size) | | TaskDetail | Full details of a frontier task, including display data, submission state, and reward info | | FrontierItemType | Frontier metadata, configuration, and reward structure | | SubmissionRecord | Historical submission record returned by the submission list / detail endpoints | | TaskInfo | Spec task info used by the /v2/spec/task/* endpoints | | TaskRewardInfo | Reward configuration attached to a task | | RankingGrade | Quality grade: 'S' \| 'A' \| 'B' \| 'C' \| 'D' | | TaskType | Task category: 'submission' \| 'validation' | | ActiveStatus | Frontier status: 'ACTIVE' \| 'INACTIVE' \| 'COMPLETED' | | MediaName | Social media identifiers used in frontier media links |

Build

npm run build

Outputs ESM (dist/index.mjs), CJS (dist/index.cjs), and type declaration files.