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

@mints-cloud/cxf-codegen

v1.0.0

Published

Plasmic CXF codegen library for Next.js applications

Downloads

92

Readme

cxf-codegen

Plasmic + CXF integration library for Next.js projects. Provides API call components, server-side rendering helpers, and authentication utilities.

Installation

npm install cxf-codegen

Setup

Your project needs thin wrapper files that import from this library. The create-plasmic-app CLI generates these automatically, but you can also create them manually:

pages/_app.tsx

import "cxf-codegen/register";
export { default } from "cxf-codegen/pages/app";

pages/api/[...path].ts

export { default } from "cxf-codegen/pages/api/cxf";

pages/api/assets/[...path].ts

export { default } from "cxf-codegen/pages/api/assets";

pages/plasmic-host.tsx

import "cxf-codegen/register";
export { default } from "cxf-codegen/pages/plasmic-host";

next.config.mjs

import { cxfNextConfig } from "cxf-codegen";
export default cxfNextConfig;

Environment Variables

Set these in your .env file:

CXF_BASE_URL=https://your-cxf-instance.com
CXF_API_KEY=your-public-api-key

Optional:

CXF_DEV_API_KEY=your-dev-api-key
CXF_USER_API_KEY=your-user-api-key

Usage

ApiCall Component

In Plasmic, use the ApiCall component to fetch data:

  • apiType: endpoint, contact, dev, or user
  • path: API path (e.g., me, blog-posts)
  • method: HTTP method
  • params: Query parameters
  • body: Request body (for POST/PATCH/PUT/DELETE)

Data is available via $ctx.response.*:

  • $ctx.response.data - The response data
  • $ctx.response.error - Error message if failed
  • $ctx.response.loading - Loading state
  • $ctx.response.success - Boolean for success
  • $ctx.response.failed - Boolean for failure

Server-Side Rendering (ISR/SSR)

Use createServerProps for pages that need pre-fetched data:

import { ServerPageWrapper, createServerProps, ServerPageProps } from "cxf-codegen";
import { PlasmicHomepage } from "../components/plasmic/Homepage";

function Homepage(props: ServerPageProps) {
  return (
    <ServerPageWrapper {...props}>
      <PlasmicHomepage />
    </ServerPageWrapper>
  );
}

export default Homepage;

// ISR (default)
export const { getStaticProps } = createServerProps("/", PlasmicHomepage);

// Or SSR for authenticated pages
export const { getServerSideProps } = createServerProps("/profile", PlasmicProfile, {
  mode: "ssr"
});

Updating

To update the library across all your projects:

npm update cxf-codegen