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

@fytkit/sdk

v0.4.0

Published

Vanilla TypeScript SDK for fytkit's public API

Downloads

879

Readme

@fytkit/sdk

Vanilla TypeScript SDK for the fytkit public API. Build a custom trainee-facing app on top of your fytkit programs, workouts, recipes, and Mux-protected video.

v0.1.x is a pre-1.0 release line. The shape of every exported type is documented in etc/sdk.api.md; breaking changes are recorded in CHANGELOG.md.

Install

pnpm add @fytkit/sdk @orpc/client
# or
npm install @fytkit/sdk @orpc/client

Pin to an exact version while the SDK is pre-1.0:

pnpm add @fytkit/[email protected] @orpc/client

Full install + version-pinning guidance: docs/developer/installation.md. Semver policy: docs/developer/concepts/versioning.md.

30-second quickstart

import { createFytkitClient } from "@fytkit/sdk";

const fytkit = createFytkitClient({
  clientId: "fk_app_xxxxxxxxxxxxxxxxx", // from /dashboard/developer
});

// Sign a trainee in (your own auth UI calls this)
const session = await fytkit.auth.signIn({
  email: "[email protected]",
  password: "their-password",
});

// Fetch their workouts
const { items } = await fytkit.workouts.list({ limit: 20 });

// Subscribe to auth state (e.g. to redirect on sign-out)
const off = fytkit.auth.onAuthStateChange((state) => {
  if (state.type === "signed_out") window.location.assign("/sign-in");
});

// Sign out — revokes the server-side session and clears local storage
await fytkit.auth.signOut();
off();

What's included in this preview

  • auth.signUp / signIn / signOut / getSession / onAuthStateChange
  • auth.requestPasswordReset / confirmPasswordReset / confirmEmail
  • Data namespaces: workouts, programs, recipes, nutrition, articles, enrollments, sessionLogs, progression, media, appConfig, subscription
  • Automatic header injection (X-Fytkit-Client-Id, Authorization: Bearer …)
  • Proactive refresh ~60 s before token expiry + reactive 401 retry
  • Pluggable token storage (localStorage default, in-memory + cookie for SSR)

Storage trade-off

Access tokens land in localStorage by default, namespaced by clientId. Any script running on your origin can read them — ship a strict CSP and treat the SDK like any other auth-bearing dependency. Token TTL is ~15 minutes and refresh requires the server, so a leaked token has a short blast radius.

Use createMemoryStorageAdapter() for SSR + tests.

Coming next

  • @fytkit/react — hooks + <FytkitVideo>
  • examples/sdk-react — runnable sample app
  • docs/sdk/quickstart.md — full guide