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

@advizorconnect/sdk

v0.2.2

Published

Typed ESM SDK for Advizor Connect v1 integration, owner, and widget APIs

Readme

@advizorconnect/sdk

Typed ESM TypeScript SDK for Advizor Connect v1 APIs. The package separates credential-specific clients and keeps group API keys out of browser runtimes by default.

Installation

Install the current public release:

npm install @advizorconnect/sdk

The previous 0.1.0 package remains visible until npm deprecation permissions are resolved.

Requirements

  • Node.js >=22
  • ESM (import) consumers
  • A server/BFF environment for group API-key integration calls

Public entrypoints

| Entrypoint | Factory | Credential | Intended runtime | |------------|---------|------------|------------------| | @advizorconnect/sdk/integration | createIntegrationClient | Group API key as Authorization: Bearer ... | Server/BFF only | | @advizorconnect/sdk/owner | createOwnerClient | Supabase owner access token from getAccessToken() per request | Owner-authenticated app or BFF | | @advizorconnect/sdk/widget | createWidgetClient | Optional short-lived widget token as X-AC-Widget-Token; public routes need no token | Browser/widget-safe | | @advizorconnect/sdk | createV1Client | Legacy API-key option | Deprecated compatibility surface for one release |

Group API keys are server-side credentials. Known browser and worker runtimes fail closed for API-key clients unless the explicitly unsafe test-only override is supplied.

Integration client (server/BFF)

import { createIntegrationClient } from '@advizorconnect/sdk/integration';

const client = createIntegrationClient({
  baseUrl: 'https://api.advizor-connect.com',
  apiKey: process.env.ADVIZOR_CONNECT_API_KEY!,
});

const { advisors } = await client.listGroupAdvisors({
  groupId: 'your-group-id',
  onlineStatus: 'available',
});

const { session } = await client.createSession({
  groupId: 'your-group-id',
  advisorId: advisors[0].id,
  callerPhone: '+15551234567',
  idempotencyKey: crypto.randomUUID(),
});

console.log('Session created:', session.id, session.status);

Owner client

import { createOwnerClient } from '@advizorconnect/sdk/owner';

const ownerClient = createOwnerClient({
  baseUrl: 'https://api.advizor-connect.com',
  getAccessToken: async () => {
    const { data } = await supabase.auth.getSession();
    return data.session?.access_token ?? null;
  },
});

const keys = await ownerClient.listApiKeys({ groupId: 'your-group-id' });

getAccessToken() is called for every SDK request and must provide a Supabase owner/admin user JWT. Owner clients do not accept group API keys.

Widget/public client

import { createWidgetClient } from '@advizorconnect/sdk/widget';

const widgetClient = createWidgetClient({
  baseUrl: 'https://api.advizor-connect.com',
  getWidgetToken: async () => widgetTokenFromYourEmbedFlow,
});

const config = await widgetClient.getWidgetConfig({ groupId: 'your-group-id' });

The widget client exposes browser-safe widget-token and public routes only. It does not expose owner/admin methods or group API-key integration methods.

Retry helper

import { withRetry } from '@advizorconnect/sdk';

const session = await withRetry(
  () => client.createSession({
    groupId: 'your-group-id',
    advisorId: 'advisor-id',
    callerPhone: '+15551234567',
    idempotencyKey: crypto.randomUUID(),
  }),
  { maxAttempts: 3, backoffMs: 500 },
);

withRetry retries only V1SdkError instances marked retryable === true and respects SDK operation metadata. Read/idempotent operations can retry when opted in; unsafe side-effecting SDK operations do not retry automatically unless the SDK operation is documented as idempotent.

Error handling

All API, timeout, network, and response-body transport failures are normalized as V1SdkError where possible:

import { V1SdkError } from '@advizorconnect/sdk';

try {
  await client.getSession({ sessionId: 'session-id' });
} catch (err) {
  if (err instanceof V1SdkError) {
    console.error('Status:', err.status);
    console.error('Message:', err.message);
    console.error('Code:', err.code);
    console.error('Request ID:', err.requestId);
    console.error('Retryable:', err.retryable);
    console.error('Operation:', err.operationId);
    console.error('Cause:', err.cause);
  }
}

TypeScript types

Root exports include shared errors/retry helpers and generated OpenAPI types:

import type {
  IntegrationAdvisor,
  SessionEnvelope,
  ApiSession,
  LedgerEvent,
  ApiKeyRecord,
  InviteRecord,
  paths,
  components,
  operations,
} from '@advizorconnect/sdk';

Subpath exports include factory-specific option and client types:

import type { IntegrationClientOptions } from '@advizorconnect/sdk/integration';
import type { OwnerClientOptions } from '@advizorconnect/sdk/owner';
import type { WidgetClientOptions } from '@advizorconnect/sdk/widget';

Release status boundaries

A successful SDK build or packed-package smoke test means the npm package artifact is locally consumable. It does not by itself mean that npm publish happened, that 0.1.0 was deprecated, that staging platform smoke passed, or that the overall public platform is production-ready. Those are separate gates owned by the release operator and the broader platform readiness work.

License

Proprietary / unlicensed for public redistribution. See package.json (UNLICENSED) and repository terms for the current package license status.