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

@croco/invitation-core

v0.0.2

Published

이메일 초대, 링크 초대, 도메인 자동 가입, 스팸 방지를 제공하는 초대 코어 패키지입니다.

Readme

@croco/invitation-core

이메일 초대, 링크 초대, 도메인 자동 가입, 스팸 방지를 제공하는 초대 코어 패키지입니다.

설치

pnpm add @croco/invitation-core

사용법

import { InMemoryInvitationStore, InvitationManager } from "@croco/invitation-core";

const store = new InMemoryInvitationStore();
const manager = new InvitationManager(
  store,
  membershipManager,
  notificationService,
  eventPublisher,
);

const token = await manager.createEmailInvitation({
  tenantId: "tenant-123",
  inviterId: "user-1",
  email: "[email protected]",
  role: "member",
});

await manager.acceptInvitation({ token, userId: "user-2", email: "[email protected]" });
import { DomainPolicyManager, InMemoryDomainPolicyStore } from "@croco/invitation-core";

const domainPolicyManager = new DomainPolicyManager(domainStore, membershipManager, eventPublisher);

await domainPolicyManager.addDomainPolicy("tenant-123", "acme.com", "member");
await domainPolicyManager.tryAutoJoin("tenant-123", "user-3", "[email protected]");

API 레퍼런스

핵심 클래스

  • InvitationManager, 초대 생성, 수락, 거절, 취소, 재전송을 담당합니다.
  • RateLimitedInvitationService, 초대 rate limit과 batch invite를 제공합니다.
  • DomainPolicyManager, 이메일 도메인 기반 자동 가입 정책을 관리합니다.
  • InMemoryInvitationStore, InMemoryDomainPolicyStore, 테스트용 저장소 구현체입니다.

저장소와 유틸리티

  • InvitationStore, DomainPolicyStore, 영속 저장소 계약입니다.
  • generateToken, hashToken, 안전한 초대 토큰 유틸리티입니다.
  • PUBLIC_EMAIL_DOMAINS, 자동 가입에서 제외할 공개 이메일 도메인 목록입니다.

주요 타입

  • CreateEmailInvitationInput, CreateLinkInvitationInput, AcceptInvitationInput
  • Invitation, InvitationCreateInput, InvitationStatus, InvitationType
  • BatchInviteOptions, BatchInviteResult, RateLimitConfig, DomainPolicy

이벤트와 문제 타입

  • 이벤트: InvitationCreatedEvent, InvitationAcceptedEvent, InvitationDeclinedEvent, InvitationRevokedEvent, DomainPolicyAddedEvent, DomainAutoJoinedEvent
  • 문제 타입: InvitationNotFoundProblem, InvitationExpiredProblem, InvitationEmailMismatchProblem, InvitationRateLimitExceededProblem, DuplicateInvitationProblem, PublicEmailDomainNotAllowedProblem

구현 포인트

  • 이메일 초대는 토큰을 해시해 저장하고, 링크 초대는 이메일 없이 공유할 수 있습니다.
  • 도메인 정책은 회사 이메일 사용자를 자동으로 멤버십에 연결할 때 유용합니다.
  • batch invite는 성공과 실패를 분리해 반환합니다.