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

lucernex-client

v0.3.3

Published

A Node based Lucernex client SDK

Readme

Lucernex API Client Library

This library is a client for the Lucernex API to be used in connector/integration projects.

Building

To build the library, run yarn build. This will compile the library into the dist folder.

Publishing

To publish the library, run npm publish. This will publish the library to the NPM registry. Make sure to update the package version.

Using in a project

To use this library in a project, just run 'yarn add lucernex-client'.

GraphQL Codegen

This project uses GraphQL Code Generator to automatically generate TypeScript types and client code from GraphQL queries.

Configuration

The codegen configuration is defined in codegen.ts. It:

  • Fetches the GraphQL schema from the Lucernex GraphQL endpoint
  • Reads GraphQL query documents from src/graphql/docs/*.graphql
  • Generates TypeScript types in src/graphql/generated/types.ts
  • Generates GraphQL Request client code in src/graphql/generated/graphql-request.ts

To note: if this needs to be regenerated, the authorization header will need to be updated. To do this, use the /rest/jwt endpoint for the https://qaretail04.lucernex.com user (user is 'AlexisL' and firm name 'Webdriver').

Running Codegen

# Generate TypeScript types from GraphQL schema and queries
yarn codegen

When to Run Codegen

Run the codegen command when:

  • You add or modify GraphQL queries in src/graphql/docs/*.graphql
  • The GraphQL schema on the backend has changed
  • You need to update the generated types for your IDE

Generated Files

The following files are automatically generated (do not edit manually):

  • src/graphql/generated/types.ts - TypeScript type definitions for GraphQL types and operations
  • src/graphql/generated/graphql-request.ts - Type-safe GraphQL client methods using graphql-request

To note: After generating you will need to format graphql-request.ts and types.ts with prettier. You will also need to add imports from types to graphql-request and remove all instances of ['input] from types.ts. It is annoying and I couldn't find a way to fix it with the codegen config.

Custom Scalar Mappings

The codegen is configured with the following scalar type mappings:

  • DateTimestring
  • Datestring
  • JSONany
  • BigDecimalnumber
  • Longnumber

API Transition: REST/XML to GraphQL

This library is currently in transition from REST/XML endpoints to GraphQL. To handle overlapping model names during this transition, GraphQL types are exported under the GraphQL namespace.

Usage Examples

import { LucernexClient, GraphQL } from 'lucernex-client';

// REST/XML models (legacy)
import { Member, Project, Program } from 'lucernex-client';

// GraphQL models (use namespace to avoid conflicts)
const gqlProject: GraphQL.Project = await graphqlClient.getProject({ lxID: 123 });
const gqlMember: GraphQL.Member = await graphqlClient.getMember({ lxID: 456 });

// You can also import directly from the graphql path
import { LxGraphQLClient, Project as GQLProject } from 'lucernex-client/dist/graphql';

GraphQL Client

const config = { baseUrl: 'https://your-instance.lucernex.com' };
const client = new GraphQL.LxGraphQLClient(config, 'your-auth-token');

// Query projects
const projects = await client.searchProjects({ 
  fiql: 'projectName==*Store*',
  limit: 10 
});

// Get a specific member
const member = await client.getMember({ lxID: 123 });