Skip to main content
Build Streamkap transforms using TypeScript with your favorite npm packages and full testing support. Use as a standalone project or integrate into your existing codebase. Repository: streamkap-com/transform-kit-typescript

Choose Your Path

🆕 New Project (Start from scratch)

Use the entire repository as your development environment

🔄 Existing Project (Add to your codebase)

Add TypeScript transform capabilities to your current project

Quick Start - New Project

Prerequisites: Node.js 16+, npm 8+
Note: You may see some npm warnings during install - these don’t affect functionality. 📋 Next: See Which File to Use? and deployment steps below.

Supported Transform Types

How to Use - New Project

1. Define Your Data Structure

Tell the system what your data looks like by editing the TypeScript files:

2. Write Your Business Logic

Open src/OrderTransformer.ts and write the code that processes your data:

3. Add External Libraries (Optional)

You can use popular JavaScript libraries to help with your transforms:
What works: JavaScript libraries like moment (dates), lodash (utilities), uuid What doesn’t work: Libraries that require system-level access or Node.js-specific features

4. Build and Test

Files are generated in the transforms/ directory.

5. Deploy to Streamkap

Coming soon: deploy using CLI , deploy using Terraform.
  1. Create your transform in the Streamkap web interface
  2. Go to the Implementation tab
  3. Copy the entire contents of your generated file:
    • Always required: valueTransform.js (your main business logic)
    • Optional: keyTransform.js (only if you need custom partitioning - leave blank otherwise)
    • Optional: topicTransform.js (only for fan-out routing - leave blank otherwise)
  4. Paste into Streamkap’s code editor (this replaces the default code)
  5. Save and Deploy - your TypeScript code is now running!
The files are completely self-contained, so just copy the entire file content.

🤔 Which File to Use?

💡 Key Points:
  • valueTransform.js is always required (contains your main business logic)
  • keyTransform.js is optional - only needed for custom partitioning logic; leave blank in Streamkap if you want to keep the original message key
  • topicTransform.js is optional - only needed for fan-out transforms to route messages to different topics; leave blank in Streamkap if sending to the original topic

Generated Files

Each file is self-contained with all npm dependencies bundled inside.

How to Use - Existing Project

Add Streamkap bundler to your existing codebase in 3 steps:

1. Copy Files

2. Update package.json

3. Connect Your Logic

Create your own OrderTransformer or update the existing one:
Then update the transform files to use your transformer:

4. Build & Deploy

That’s it! Your transforms are generated in transforms/ folder. 📋 Next: See Which File to Use? below for deployment guidance.

Real-World Examples

These are just examples - replace the data types and logic with your own use case.

Order Processing

Sensor Data

Order Processing (Actual Implementation)

Key Files You’ll Work With

New Project:
Existing Project:
Both approaches generate:

What You Get

  • Type Safety: Catch errors before deployment with TypeScript
  • Rich Ecosystem: Use thousands of npm packages in your transforms
  • Testing: Automated tests ensure your code works correctly
  • Self-Contained: Generated files include everything needed - no external dependencies
  • All Transform Types: Works with every Streamkap transform type
  • Two Integration Options: Use as standalone project or integrate into existing codebase
  • Standard Workflow: Familiar git-based development process

Troubleshooting

Tests failing?
Build errors?
Only need specific transforms?
Streamkap deployment not working?
  • Make sure you copy the entire file contents (including all the bundled code)
  • Always run npm test locally before deploying
  • Check the Streamkap error console for specific error messages
Always run npm run build before npm test. The tests check the actual files that get deployed to Streamkap.

Need More Details?

This guide covers the basics. For advanced usage, troubleshooting, and detailed explanations, check the README.md file in the repository.