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

@scrydon/sdk

v0.1.8

Published

TypeScript SDK for Scrydon - AI workflow platform

Readme

@scrydon/sdk

TypeScript SDK for Scrydon. Sign in via OAuth, trigger workflows, query knowledge bases, upload files, and stream chat — from the browser or Node.

Installation

npm install @scrydon/sdk

Quick start

import { ScrydonClient } from "@scrydon/sdk";

const client = new ScrydonClient({
  baseUrl: "https://your-instance.scrydon.com",
  clientId: "your-client-id",
  redirectUri: "http://localhost:3000/callback",
});

await client.auth.signIn();                 // redirects to login
const session = await client.auth.handleCallback();  // call this from your callback page

After handleCallback() resolves, every other call on client carries the access token automatically.

Authentication

OAuth 2.0 with PKCE. The PKCE verifier is stored in sessionStorage in browsers and in memory elsewhere.

await client.auth.signIn();                 // start the flow
const session = await client.auth.handleCallback(callbackUrl);
const current = await client.auth.getSession();   // null if not signed in; auto-refreshes near expiry
await client.auth.signOut();

const unsubscribe = client.auth.onAuthStateChange((session) => {
  // fires on sign-in, sign-out, and token refresh
});

session.accessToken is issued by Scrydon's OAuth provider. The SDK refreshes it transparently within 60 seconds of expiry; if the refresh fails, listeners receive null.

Workflows

Trigger deployed workflows synchronously (waits up to 30 s for a result) or asynchronously.

const result = await client.workflows.trigger({
  workflowId: "wf-123",
  inputs: { prompt: "Analyse this data" },
});

const { executionId } = await client.workflows.triggerAsync({
  workflowId: "wf-123",
  inputs: { prompt: "Process in background" },
});

const status = await client.workflows.getStatus(executionId);

Knowledge bases

Query and ingest documents.

const results = await client.knowledge.query({
  question: "What is our refund policy?",
  collection: "support-docs",
});

await client.knowledge.ingest({
  documents: [file1, file2],
  collection: "support-docs",
});

Storage

Upload files (multipart) and generate presigned download URLs.

const { url } = await client.storage.upload(myFile, {
  path: "documents/report.pdf",
});

const downloadUrl = await client.storage.getUrl("documents/report.pdf");

Chat

Stream AI responses from a deployed chat surface.

const stream = client.chat.stream({
  deploymentId: "deployment-id",
  message: "Hello!",
});

for await (const token of stream) {
  process.stdout.write(token);
}

Platform API (data / ai / action) — preview

The client.data.*, client.ai.*, and client.action.* namespaces expose Scrydon's full platform surface — storage, memory, knowledge graphs, LLM completions, email, SMS, web search, and more — through the same OAuth bearer path as workflow, knowledge, storage, and chat calls.

// data — platform-managed durable state
const file = await client.data.storage.read({ path: "reports/q1.md" });
await client.data.memory.add({ role: "user", content: "Remember this", conversationId: "c1" });

// ai — model-backed inference
const completion = await client.ai.llm.complete({
  model: "claude-sonnet-4-5",
  messages: [{ role: "user", content: "Summarise the Q1 report." }],
});

// action — outbound side-effects
await client.action.email.send({
  smtpHost: "smtp.example.com", smtpPort: 587,
  smtpUsername: "u", smtpPassword: "p", smtpSecure: "tls",
  from: "[email protected]", to: "[email protected]",
  subject: "Q1 report", body: "See attached.",
});

React integration

npm install @scrydon/sdk react
import {
  ScrydonProvider,
  useScrydon,
  useScrydonAuth,
  useChatStream,
} from "@scrydon/sdk/react";
import { ScrydonClient } from "@scrydon/sdk";

const client = new ScrydonClient({ baseUrl: "...", clientId: "...", redirectUri: "..." });

function App() {
  return (
    <ScrydonProvider client={client}>
      <Inner />
    </ScrydonProvider>
  );
}

function Inner() {
  const { client } = useScrydon();
  const { user, isAuthenticated, signIn, signOut } = useScrydonAuth();
  const { messages, isStreaming, send, reset } = useChatStream("deployment-id");
  // ...
}

useScrydonAuth re-renders on sign-in, sign-out, and token refresh. useChatStream accumulates streamed tokens into messages and exposes isStreaming for UI state.

Errors

All SDK errors extend ScrydonError and carry a stable code:

import {
  ScrydonAuthError,
  ScrydonForbiddenError,
  ScrydonRateLimitError,
  ScrydonValidationError,
  ScrydonServerError,
} from "@scrydon/sdk";

try {
  await client.workflows.trigger({ workflowId: "wf-123" });
} catch (error) {
  if (error instanceof ScrydonAuthError)        client.auth.signIn();           // 401
  else if (error instanceof ScrydonRateLimitError) wait(error.retryAfter);     // 429
  else if (error instanceof ScrydonValidationError) console.log(error.details); // 400
  else throw error;
}

| Error | HTTP | When | |---|---|---| | ScrydonAuthError | 401 | Token missing, expired, or rejected | | ScrydonForbiddenError | 403 | Authenticated but not authorized | | ScrydonValidationError | 400 | Bad input — error.details carries field-level info | | ScrydonRateLimitError | 429 | error.retryAfter is seconds to wait | | ScrydonServerError | 5xx | Server-side failure |

TypeScript

Full type support. Public types are exported from the root and from the /types subpath:

import type {
  ScrydonConfig,
  ScrydonSession,
  WorkflowResult,
  KnowledgeResult,
} from "@scrydon/sdk";

Platform API types (ScrydonSDK plus per-route param/result types like StorageReadParams) are also exported from the root. Use ScrydonSDK["data"], ScrydonSDK["ai"], or ScrydonSDK["action"] for sliced domain types.

License

MIT