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

@noorden/sdk

v0.1.5

Published

SDK TypeScript da Noorden Platform — agents, sessions e streaming de eventos.

Downloads

957

Readme

@noorden/sdk

SDK TypeScript da Noorden Platform — agents, sessions e streaming de eventos (SSE).

Documentação interativa: platform.noorden-insurtech.dev/docs


Quickstart

1. Pré-requisitos

  • Node ≥ 18
  • API key de projeto (rxk_…) — gere em Settings → API keys no console da plataforma
export NOORDEN_API_KEY=rxk_live_<sua-chave-de-projeto>
# opcional — default: https://harness-api-dev.up.railway.app
export NOORDEN_API_URL=https://harness-api-dev.up.railway.app

Variáveis legadas ROUX_API_KEY / ROUX_API_URL ainda funcionam como fallback.

2. Instalação

pnpm add @noorden/sdk
# ou: npm install @noorden/sdk

3. Primeiro agent (~10 linhas)

import Noorden, { isAgentMessage } from '@noorden/sdk';

const client = new Noorden.Platform();

const agent = await client.agents.create({
  name: 'atendente',
  model: 'anthropic/claude-haiku-4-5',
  system: 'Você é um atendente de seguros. Responda em português.',
});

const session = await client.sessions.create({
  agent: { id: agent.id, version: agent.version },
  metadata: { userId: 'u_123' },
});

const run = await session.send('Quanto custa um seguro de vida?');

for await (const event of run.stream()) {
  if (isAgentMessage(event)) {
    console.log('Agent:', event.text);
  }
}

O projectId vem da API key automaticamente (GET /v1/platform/context) — não precisa passar no construtor nem enviar x-roux-workspace.

4. Tools customizadas (client-side)

import Noorden, { defineTool, isAgentMessage, isAgentCustomToolUse } from '@noorden/sdk';
import { z } from 'zod';

const cotacaoTool = defineTool({
  name: 'cotar_seguro_vida',
  description: 'Calcula prêmio mensal de seguro de vida.',
  schema: z.object({ idade: z.number(), capital: z.number() }),
  execute: async (input) => ({
    content: [{ type: 'text', text: JSON.stringify({ premioMensal: input.capital * 0.0012 }) }],
  }),
});

const client = new Noorden.Platform();
const agent = await client.agents.create({
  name: 'corretor',
  model: { id: 'anthropic/claude-haiku-4-5', temperature: 0.3 },
  tools: ['get_current_time', cotacaoTool],
});

const session = await client.sessions.create({
  agent: { id: agent.id, version: agent.version },
});

const run = await session.send('Cotação para 35 anos, capital R$ 200k.');

for await (const event of run.stream()) {
  if (isAgentMessage(event)) {
    console.log('Agent:', event.text);
  } else if (isAgentCustomToolUse(event)) {
    const out = await cotacaoTool.execute(event.input as { idade: number; capital: number }, {
      sessionId: session.id,
      toolUseId: event.toolUseId,
      signal: new AbortController().signal,
    });
    await run.respondTool(event.toolUseId, {
      content: out.content.map((b) => b.text).join('\n'),
      isError: out.isError,
    });
  }
}

5. Exemplo completo (WhatsApp fictício)

export NOORDEN_API_KEY=rxk_live_<sua-chave>
pnpm --filter @noorden/sdk-example-whatsapp start

API pública

| Recurso | Métodos principais | | ----------------- | -------------------------------------- | | client.agents | create, get, list, update | | client.sessions | create, get, list | | session | send, events, stream (via Run) |

Construtor opcional:

new Noorden.Platform({
  apiKey: 'rxk_…',
  baseUrl: 'https://…',
  timeoutMs: 30_000,
  maxRetries: 2,
});

Auth

Autenticação por API key de projeto (scope: project). O SDK envia Authorization: Bearer <key> e resolve o projectId na primeira request.

Chaves são criadas no console (Settings → API keys), vinculadas ao projeto ativo.


Aliases legados (deprecated)

Harness, HarnessError e HarnessOptions ainda exportam, mas preferir Platform, PlatformError e PlatformOptions.