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

@shopnex/cj-plugin

v1.0.10

Published

A blank template to get started with Payload 3.0

Readme

CJ Dropshipping Plugin for Payload CMS

This plugin integrates CJ Dropshipping into your Payload CMS project by:

  • Adding "CJ" as a product source.
  • Automatically creating CJ orders after local orders are created.
  • (Optionally) generating a cj-settings collection for managing API credentials dynamically.
  • Syncing CJ credentials on app initialization.

Installation

pnpm install @shopnex/cj-plugin

or

npm install @shopnex/cj-plugin

or

yarn add @shopnex/cj-plugin

Usage

Import and add the cjPlugin to your Payload config:

import { buildConfig } from "payload/config";
import { cjPlugin } from "@shopnex/cj-plugin";

export default buildConfig({
    collections: [
        // your collections
    ],
    plugins: [
        cjPlugin({
            cjApiKey: "your-cj-api-key",
            cjEmailAddress: "[email protected]",
            cjRefreshToken: "optional-refresh-token", // optional
            asCollection: true, // optional - creates a cj-settings collection
            collectionOverrides: {
                // optional - override fields or settings for the cj-settings collection
            },
        }),
    ],
});

Plugin Options

| Option | Type | Required | Description | | --------------------- | --------- | -------- | ------------------------------------------------------------------------------------------------------- | | cjApiKey | string | Yes | Your CJ Dropshipping API key. | | cjEmailAddress | string | Yes | Your CJ account email address. | | cjRefreshToken | string | No | Your CJ refresh token if available. | | asCollection | boolean | No | If true, automatically creates a cj-settings collection to manage CJ API credentials per tenant/shop. | | collectionOverrides | object | No | Allows overriding the default cj-settings collection config (fields, hooks, etc). |


What the Plugin Does

  • Modifies the products collection:
    • Adds a source option: { label: 'CJ', value: 'cj' }.
  • Hooks into the orders collection:
    • On every new order or update, triggers the CJ order creation logic automatically.
  • Manages CJ credentials dynamically:
    • On Payload startup (onInit), loads all cj-settings documents and sets up credentials per shop.
  • Optional cj-settings collection:
    • If asCollection is true, a new cj-settings collection will be added automatically.
    • Useful for multi-tenant setups or dynamically changing credentials.

Example: cj-settings Collection

If asCollection: true, the following collection will be generated by default:

| Field | Type | Description | | ---------- | -------- | --------------------------------- | | shop | Relation | Reference to your shop or tenant. | | email | Text | Your CJ email address. | | apiToken | Text | Your CJ API key. |

You can override this structure with collectionOverrides.


Notes

  • The plugin assumes you have a products collection with a source select field already created.
  • It assumes you have an orders collection.
  • Make sure the source field in products uses a select type with options array.

License

MIT