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/auth-clerk

v0.0.2

Published

Clerk Backend SDK를 Croco 인증, 세션, 조직 API에 연결하는 패키지입니다.

Readme

@croco/auth-clerk

Clerk Backend SDK를 Croco 인증, 세션, 조직 API에 연결하는 패키지입니다.

설치

pnpm add @croco/auth-clerk @clerk/backend

사용법

1. 토큰 인증

import { ClerkAuthProvider } from "@croco/auth-clerk";

const authProvider = new ClerkAuthProvider({
  secretKey: process.env.CLERK_SECRET_KEY!,
  publishableKey: process.env.CLERK_PUBLISHABLE_KEY,
});

const user = await authProvider.authenticate(request);

2. 세션 조회와 해제

import { ClerkSessionProvider } from "@croco/auth-clerk";

const sessions = new ClerkSessionProvider({
  secretKey: process.env.CLERK_SECRET_KEY!,
});

const session = await sessions.getSession("sess_123");
await sessions.revokeAllSessions("user_123");

3. 사용자와 조직 관리

import { ClerkOrganizationService, ClerkUserService } from "@croco/auth-clerk";

const options = { secretKey: process.env.CLERK_SECRET_KEY! };
const users = new ClerkUserService(options);
const organizations = new ClerkOrganizationService(options);

await users.createUser({
  emailAddress: ["[email protected]"],
  firstName: "Croco",
});

await organizations.createOrganization({
  name: "Croco Team",
  createdBy: "user_123",
});

4. 테넌트 매핑

import { ClerkTenantMapper } from "@croco/auth-clerk";

const mapper = new ClerkTenantMapper();
await mapper.register("org_123", "tenant_123");
const tenantId = await mapper.resolve("org_123");

5. 웹훅 처리

import { ClerkWebhookHandler } from "@croco/auth-clerk";

const handler = new ClerkWebhookHandler(
  { signingSecret: process.env.CLERK_WEBHOOK_SECRET! },
  {
    "user.created": async (event) => {
      await syncUser(event.id);
    },
  },
);

await handler.handleWebhook(request);

API 레퍼런스

| API | 설명 | | --------------------------------------- | --------------------------------------------------------- | | ClerkAuthProvider | Bearer 토큰을 검증하고 AuthUser를 반환합니다. | | ClerkSessionProvider | Clerk 세션 조회, 목록 조회, 세션 해제를 처리합니다. | | ClerkUserService | 사용자 조회, 생성, 수정, 삭제, 밴 관리를 제공합니다. | | ClerkOrganizationService | 조직, 멤버십, 초대 관리를 제공합니다. | | ClerkTenantMapper | Clerk 조직 ID와 Croco tenant ID를 매핑합니다. | | ClerkWebhookHandler | Clerk 서명을 검증하고 이벤트별 핸들러를 실행합니다. | | WebhookVerificationProblem 외 Problem | 토큰, 웹훅, tenant 매핑 오류를 Problem 형태로 제공합니다. |

공개 타입

  • ClerkAuthOptions
  • ClerkUser, CreateClerkUserInput, UpdateClerkUserInput
  • ClerkOrganization, CreateOrganizationInput, CreateInvitationInput
  • ClerkTenantRequest, TenantMappingStore
  • WebhookHandlerOptions, WebhookEventHandler, WebhookEventType