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

@newageerp/node-sessions

v1.0.18

Published

```bash npm install @newageerp/node-sessions ```

Readme

Install

npm install @newageerp/node-sessions

ENV variables

  • CRM_SESSION_BACKEND_V3
  • SESSION_PROJECT

.env / .env.stg example

CRM_SESSION_BACKEND_V3=https://session.crm.apidata.app
  • SESSION_PROJECT - unique project name with locale (if not EN)
    • todayistheday
    • todayistheday-es
    • mellowflow
    • mellowflow-es
    • ...

.env.prod example

  • CRM_SESSION_BACKEND_V3 - replace apidata.app with project domain (if this is a test/RnD project, then use the domain of the main project, whose payments are used)
  • SESSION_PROJECT - as .env/.env.stg

middleware.ts

import { sessionNextSrv } from '@newageerp/node-sessions'

export async function middleware(req: NextRequest) {
    const sessionResp = await sessionNextSrv.checkForRoutes(req)
    if (sessionResp) {
        return sessionResp
    }
}

export const config = {
    matcher: '/((?!_next/static|_next/image|favicon.ico).*)',
}

Usage session

set data

in examples you can see sessionBrowser or sessionSrv calls, make sure you are using the correct method depending on the context.

Almost all methods are available in both environments

create [- IMPORTANT -]

most often after completing the quiz or when we receive the user’s email (whichever comes first)


const sessionId = await sessionBrowser.create({
    extraData: {
        currency: currency,
        quiz: quizResults.answers.raw,
    },
})

append [- IMPORTANT -]

if there was no mail when creating session, then add it as soon as we received it

await sessionBrowser.append({
    id: uuid,
    extraData: {
        email: email.trim(),
    },
});

get data

in examples you can see sessionBrowser or sessionSrv calls, make sure you are using the correct method depending on the context.

Almost all methods are available in both environments

get session data


const sessionData = await sessionBrowser.get({ id })

get quiz data


const sessionData = await sessionSrv.getQuiz({ id })

Usage key/value storage

it is supposed to be used when you need to save a value on the front (for example, a parameter passed via query string) yet have neither an uuid nor an email and then later receive this value on the backend or frontend

set data

add key value by session ID

import { keyValueBrowser } from '@newageerp/node-sessions'

keyValueBrowser.addKeyValueByAnalyticsIdBrowser({
    dataKey: 'unique key',
    dataValue: {}
})

add key value by order ID

import { keyValueBrowser } from '@newageerp/node-sessions'

keyValueBrowser.addKeyValueByUuidBrowser({
    uuid,
    dataKey: 'unique key',
    dataValue: {}
})

get data

get value by session ID

import { keyValueBrowser } from '@newageerp/node-sessions'

const dataValue = await keyValueBrowser.getKeyValueByAnalyticsIdBrowser({
    dataKey: 'unique key',
})

get value by order ID

import { keyValueBrowser } from '@newageerp/node-sessions'

const dataValue = keyValueBrowser.getKeyValueByUuidBrowser({
    uuid,
    dataKey: 'unique key',
})

get value by session ID (server version)

import { keyValueNext } from '@newageerp/node-sessions'

const dataValue = await keyValueNext.getKeyValueByAnalyticsIdNext({
    dataKey: 'unique key',
})