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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@imqa/session

v1.0.0

Published

[![NPM Published Version][npm-img]][npm-url]

Downloads

13

Readme

IMQA Session 패키지

NPM Published Version

Session 패키지는 웹 애플리케이션에서 세션 관리를 효율적으로 수행할 수 있도록 도와주는 도구입니다. 이 패키지는 사용자 활동을 추적하고, 세션 ID를 관리하며, 세션의 유효성을 유지하는 기능을 제공합니다.

목차

특징

  • 세션 관리: 사용자 세션을 생성하고 관리합니다.
  • 활동 감지: 사용자의 활동을 실시간으로 감지하여 세션 유지를 돕습니다.
  • 쿠키 기반 세션 ID: 세션 ID를 쿠키에 저장하여 지속성을 보장합니다.
  • 유연한 설정: 최대 세션 기간, 비활동 타임아웃 등 다양한 설정이 가능합니다.

설치

npm install @imqa/session

사용법

세션 초기화

패키지를 사용하기 전에 세션 관리를 초기화해야 합니다.

import { initializeSession } from '@imqa/session';

initializeSession({
  maxSessionAgeMillis: 14400000, // 4시간
  inactivityTimeoutSeconds: 900,  // 15분
  periodicCheckSeconds: 60,       // 1분
});

세션 ID 설정

세션 ID를 설정하려면 setSessionId 함수를 사용하세요. 이 함수는 전역 window 객체에 추가됩니다.

window.setSessionId('your-session-id');

세션 정보 접근

현재 세션 ID나 기타 정보를 접근하려면 관련 변수를 활용할 수 있습니다.

import { COOKIE_NAME, rumSessionId } from '@imqa/session';

console.log(`Session ID: ${rumSessionId}`);
console.log(`Cookie Name: ${COOKIE_NAME}`);

API 문서

setSessionId(sessionId: string): void

세션 ID를 설정하는 함수입니다. 이 함수는 전역 window 객체에 추가되어 어디서든 호출할 수 있습니다.

  • 매개변수:
    • sessionId: string - 설정할 세션 ID

예제:

window.setSessionId('new-session-id-123');

COOKIE_NAME

세션 ID를 저장하는 쿠키의 이름입니다.

  • 타입: string

예제:

import { COOKIE_NAME } from '@imqa/session';

console.log(`Session Cookie Name: ${COOKIE_NAME}`);

환경 설정

세션 패키지는 다음과 같은 환경 변수를 사용할 수 있습니다.

  • MaxSessionAgeMillis
    • 세션의 최대 유효 기간을 밀리초 단위로 설정합니다. 기본값은 4시간(14400000ms)입니다.
    • 기본값: 4 * 60 * 60 * 1000 (4시간)
  • InactivityTimeoutSeconds
    • 비활동 상태로 간주되기까지의 시간을 초 단위로 설정합니다. 기본값은 15분(900초)입니다.
    • 기본값: 15 * 60 (15분)
  • PeriodicCheckSeconds
    • 세션 유효성을 주기적으로 검사하는 주기를 초 단위로 설정합니다. 기본값은 1분(60초)입니다.
    • 기본값: 60 (1분)