◈ PulseFlow Cloud / JavaScript SDK
Fictional SDK · local browser demo

Integration guide / ESM first

Install deliberately. Verify the boundary.

The documentation targets a fictional Node.js SDK and modern browser simulator. Only the static simulator is implemented in this repository.

Runtime compatibility

EnvironmentReference targetNotes
Node.js server20 or newerNative fetch and AbortController assumed
TypeScript5.4 or newerStrict mode and NodeNext module resolution
Browser playgroundCurrent evergreen browsersNo token, bundle or external imports
Edge runtimesWeb-standard APIsAvoid Node-specific filesystem assumptions

Illustrative package setup

# Fictional package examples — not required by this repository.
npm install --save-exact @pulseflow/cloud-sdk@2.4.0
# Equivalent examples:
pnpm add --save-exact @pulseflow/cloud-sdk@2.4.0
yarn add --exact @pulseflow/cloud-sdk@2.4.0

In a real integration, verify package provenance, publisher identity, license and the lockfile before installation. Pin a reviewed version and use an immutable install in CI. Do not use an unpinned download script as a production bootstrap mechanism.

Module and compiler configuration

{
  "compilerOptions": {
    "target": "ES2022",
    "module": "NodeNext",
    "moduleResolution": "NodeNext",
    "strict": true,
    "noUncheckedIndexedAccess": true
  }
}

The reference API uses named ESM exports. A server entry point should validate configuration at startup, create one client per process and flush buffered events during an orderly shutdown. Never instantiate a new connection or exporter for every span.

Run the implemented demo

git clone https://github.com/harishs2k26-art/pulseflow-sdk-js.git
cd pulseflow-sdk-js
python3 -m http.server 8000

Open http://localhost:8000/, generate a trace, toggle the synthetic error and reset the form. The script uses text rendering rather than HTML insertion. The workflow name stays in browser memory, is never sent to a server and disappears when the page is reloaded.

Configuration precedence in the reference design

  1. Explicit constructor options override environment-derived defaults.
  2. The selected region determines the ingestion endpoint; it must match the workspace.
  3. The token comes from a server-side secret source, not a checked-in configuration file.
  4. A bounded queue and timeout protect the application from exporter stalls.

Document configuration precedence in your application so an environment variable cannot silently move telemetry to the wrong region. Reject an empty workspace ID rather than falling back to another team's workspace.

Smoke tests before rollout

Continue to authentication and error handling. Consult the changelog for the 2.3-to-2.4 compatibility checklist.