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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@cortec/temporal

v1.2.2

Published

Temporal module for Cortec

Readme

@cortec/temporal

Module Overview

@cortec/temporal provides integration with Temporal for orchestrating distributed workflows and microservices. It supports both Temporal clients and workers, with flexible TLS configuration options (filesystem or AWS S3). This module is designed to be used within the Cortec framework, allowing you to manage Temporal connections and namespaces declaratively.


Configuration Options

Where to put config: Place your Temporal config in config/default.yml (or your environment-specific config file).

Schema:

temporal:
  clients:
    main:
      namespace: "default"                # Temporal namespace
      address: "temporal.example.com:7233"# Temporal server address
      tls:
        source: "filesystem"              # "filesystem" or "s3"
        paths:
          ca: "/path/to/ca.pem"           # optional, CA certificate
          cert: "/path/to/cert.pem"       # required, client certificate
          key: "/path/to/key.pem"         # required, client key
  workers:
    worker1:
      namespace: "default"
      address: "temporal.example.com:7233"
      tls:
        source: "s3"
        region: "us-east-1"               # AWS region (required for S3)
        bucket: "my-tls-bucket"           # S3 bucket name (required for S3)
        paths:
          ca: "ca.pem"                    # optional, CA certificate in S3
          cert: "cert.pem"                # required, client certificate in S3
          key: "key.pem"                  # required, client key in S3

Field-by-field explanation:

  • temporal: Root key for Temporal config.
  • clients: Map of client identities to config.
    • namespace: Temporal namespace (string, required).
    • address: Temporal server address (string, required).
    • tls: TLS configuration for secure connection.
      • source: "filesystem" or "s3". Determines where TLS certs are loaded from.
      • paths: Object with certificate file paths or S3 keys.
        • ca: CA certificate (optional, recommended for security).
        • cert: Client certificate (required).
        • key: Client key (required).
      • For S3:
        • region: AWS region (required).
        • bucket: S3 bucket name (required).
  • workers: Map of worker identities to config (same structure as clients).

How config is loaded: The config is loaded automatically by the @cortec/config module and validated at runtime. Access it in code via:

const config = ctx.provide<IConfig>('config');
const temporalConfig = config?.get<any>('temporal');

If config is missing or invalid, an error is thrown at startup.

Caveats:

  • TLS certificates must be accessible at the configured paths or S3 locations.
  • If any required field is missing, the module will throw an error and fail to connect.
  • You can define multiple clients and workers for different namespaces or environments.

Example Usage

Registering the Temporal Module

import Temporal from '@cortec/temporal';

// Register the module in your Cortec context
const temporal = new Temporal();
context.use(temporal);

// After context.load()
const client = temporal.client('main');
const worker = temporal.worker('worker1');

// Access namespace and connection
console.log(client.namespace); // "default"
console.log(worker.connection); // NativeConnection instance

Connecting to Temporal

The module automatically loads connections based on your config. TLS certificates are loaded from either the filesystem or S3, as specified.

Closing Connections

When disposing the context, all Temporal connections are closed automatically.


API

  • temporal.client(identity: string): { namespace: string, connection: Connection }
  • temporal.worker(identity: string): { namespace: string, connection: NativeConnection }

Notes

  • Ensure your TLS certificates are accessible at the configured paths or S3 locations.
  • The module will throw if a requested client or worker identity is not found in the config.
  • For advanced usage, see the Temporal Node SDK documentation: https://docs.temporal.io/typescript/introduction