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

@aceint/auth

v1.0.2

Published

Thin TypeScript SDK for Aceint public SaaS auth APIs.

Readme

@aceint/auth

Low-level TypeScript SDK for Aceint client-auth token issuance, refresh, and revoke flows.

Use This Package For

  • issuing access and refresh tokens from your backend
  • refreshing access tokens with a valid refresh token
  • revoking a refresh token or token family

This package is intended for backend or server environments.

Do not use it directly from your frontend application. Frontend apps should call your backend, and your backend should call Aceint.

If you are integrating Aceint AI interview session APIs and want the SDK to manage token reuse and refresh on your backend, use @aceint/ai-interviews.

Requirements

  • Node.js >=18
  • Aceint client credentials from the Aceint Credentials tab

Installation

npm install @aceint/auth

Public Modes

The SDK uses explicit modes instead of raw URLs.

  • devhttps://dev.aceint.ai/backend/api/v1
  • prodhttps://interview.aceint.ai/backend/api/v1

Use dev for development, QA, and integration testing.

Use prod for live production traffic.

Quick Start

import { SaasAuthClient } from '@aceint/auth';

const client = new SaasAuthClient({
  mode: 'dev',
  clientPublicId: process.env.ACEINT_CLIENT_PUBLIC_ID!,
  apiKey: process.env.ACEINT_API_KEY!,
  apiSecret: process.env.ACEINT_API_SECRET!,
});

const token = await client.getToken({ accessTtl: '15m' });
console.log(token.access_token);

Switch mode to prod when you are ready for production traffic.

Credential Mapping

Pass the credential values exactly as issued in Aceint:

  • clientPublicId -> client_public_id
  • apiKey -> ACEINT_API_KEY
  • apiSecret -> ACEINT_API_SECRET

Store these values only in your backend environment or secret manager.

Supported TTL Values

  • 15m
  • 30m
  • 1h
  • 6h
  • 24h

never is not supported for access_ttl. Access tokens always expire.

never applies only to credential-side refresh_ttl policies, not to access_ttl.

Token Lifetime Fields

Successful token responses include:

  • expires_in: seconds until the access token expires
  • refresh_expires_in: seconds until the refresh token expires

API

new SaasAuthClient(options)

Creates a client configured for one Aceint environment and one set of client credentials.

client.getToken(options?)

Uses the configured mode and credentials to call POST /client-auth/token.

const token = await client.getToken({ accessTtl: '15m' });

Allowed access TTL values for getToken: 15m, 30m, 1h, 6h, 24h.

client.refreshToken(input)

Calls POST /client-auth/refresh.

const nextToken = await client.refreshToken({
  refreshToken: token.refresh_token,
  accessTtl: '30m',
});

Allowed access TTL values for refreshToken: 15m, 30m, 1h, 6h, 24h.

client.revokeToken(input)

Calls POST /client-auth/revoke.

const revoked = await client.revokeToken({
  refreshToken: token.refresh_token,
  revokeFamily: true,
});

Example Flow

import { SaasAuthClient } from '@aceint/auth';

const client = new SaasAuthClient({
  mode: 'dev',
  clientPublicId: process.env.ACEINT_CLIENT_PUBLIC_ID!,
  apiKey: process.env.ACEINT_API_KEY!,
  apiSecret: process.env.ACEINT_API_SECRET!,
});

const token = await client.getToken({ accessTtl: '15m' });

// Use token.access_token against your protected Aceint APIs.

const refreshed = await client.refreshToken({
  refreshToken: token.refresh_token,
  accessTtl: '15m',
});

await client.revokeToken({
  refreshToken: refreshed.refresh_token,
  revokeFamily: true,
});

Recommended Integration Pattern

Use this package inside a reusable backend service layer such as AceintService.

Recommended request flow:

frontend -> your backend -> AceintService -> Aceint API

The SDK is intentionally thin. Your backend service layer should decide when to:

  • reuse an active access token
  • refresh an expired access token
  • request a brand-new token with stored credentials
  • attach Authorization: Bearer <access_token> to upstream Aceint API calls

For Aceint AI interview session integrations, @aceint/ai-interviews is the higher-level package built on top of this one.

Response Types

type TokenResponse = {
  access_token: string;
  refresh_token: string;
  expires_in: number;
  refresh_expires_in: number;
  token_type: 'Bearer';
};

type RevokeResponse = {
  success: boolean;
  revoked: Record<string, unknown> | null;
};

Error Handling

The SDK throws SaasAuthError for request failures. It preserves:

  • backend message
  • HTTP status code
  • parsed response body when available

Notes

  • This SDK does not cache tokens.
  • This SDK does not auto-refresh tokens for you.
  • This SDK is the low-level auth layer, not the full AI interview session SDK.