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

appclerk-core

v0.1.3

Published

Core SDK for AppClerk - Platform-agnostic compliance infrastructure

Readme

appclerk-core

Core SDK for AppClerk - Platform-agnostic compliance infrastructure.

Installation

npm install appclerk-core
# or
yarn add appclerk-core
# or
pnpm add appclerk-core

Usage

import { init } from "appclerk-core";

// Initialize SDK
const appclerk = init({
	apiKey: process.env.APPCLERK_API_KEY,
	projectId: process.env.APPCLERK_PROJECT_ID,
});

// Get document markdown
const privacyPolicy = await appclerk.getDocumentMarkdown("privacy-policy");
console.log(privacyPolicy.content);

// Get document metadata
const metadata = await appclerk.getDocumentMetadata("privacy-policy");
console.log(metadata.hostedUrl);

// Get compliance status
const compliance = await appclerk.getComplianceStatus();
console.log(compliance.score);

// Get hosted URLs
const privacyUrl = await appclerk.getPrivacyPolicyUrl();
const termsUrl = await appclerk.getTermsUrl();

API Reference

init(config: AppClerkConfig): AppClerk

Initialize the SDK with your API key and project ID.

Config:

  • apiKey (string, required): Your AppClerk API key
  • projectId (string, required): Your AppClerk project ID
  • apiUrl (string, optional): Custom API URL (defaults to production)
  • debug (boolean, optional): Enable debug logging
  • cacheTtl (number, optional): Cache TTL in milliseconds (default: 5 minutes)
  • maxRetries (number, optional): Maximum retry attempts (default: 3)

getDocumentMarkdown(documentType: DocumentType): Promise<DocumentContent>

Fetch markdown content for a document.

Returns:

  • content: Markdown content
  • lastUpdated: ISO 8601 timestamp
  • version: Document version number
  • title: Document title
  • hostedUrl: Public hosted URL

getDocumentMetadata(documentType: DocumentType): Promise<DocumentMetadata>

Fetch document metadata without content.

Returns:

  • title: Document title
  • lastUpdated: ISO 8601 timestamp
  • version: Document version number
  • hostedUrl: Public hosted URL
  • status: Document status

getComplianceStatus(): Promise<ComplianceStatus>

Get overall compliance status for the project.

Returns:

  • score: Overall compliance score (0-100)
  • status: Compliance status
  • verificationStatus: Verification status
  • issues: Array of compliance issues
  • documents: Array of document compliance statuses
  • lastChecked: ISO 8601 timestamp

getPrivacyPolicyUrl(): Promise<string>

Get hosted URL for privacy policy.

getTermsUrl(): Promise<string>

Get hosted URL for terms of service.

clearCache(): void

Clear all cached data.

Error Handling

The SDK throws custom error classes:

  • AuthenticationError: Invalid API key (401)
  • AuthorizationError: Access denied (403)
  • NotFoundError: Resource not found (404)
  • RateLimitError: Rate limit exceeded (429)
  • ValidationError: Invalid request (400)
  • NetworkError: Network request failed
  • ServerError: Server error (500+)
import { NotFoundError, RateLimitError } from "appclerk-core";

try {
	const doc = await appclerk.getDocumentMarkdown("privacy-policy");
} catch (error) {
	if (error instanceof NotFoundError) {
		console.error("Document not found");
	} else if (error instanceof RateLimitError) {
		console.error("Rate limit exceeded", error.retryAfter);
	}
}

Caching

The SDK includes built-in in-memory caching:

  • Document content: 5 minutes (configurable)
  • Document metadata: 5 minutes (configurable)
  • Compliance status: 1 minute

Cache is automatically cleaned up and can be cleared with clearCache().

Retry Logic

The SDK automatically retries failed requests:

  • Network errors: Up to 3 retries with exponential backoff
  • Rate limit errors: Retries after the Retry-After header delay

License

MIT

Official documentation: https://appclerk.dev/docs/sdk/core Appclerk React Native/Expo: https://appclerk.dev/docs/sdk/react-native Appclerk React: https://appclerk.dev/docs/sdk/react