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 projectQuick Start - New Project
Prerequisites: Node.js 16+, npm 8+Supported Transform Types
Transform Type | Files Generated | Description |
---|---|---|
Map/Filter | valueTransform.js , keyTransform.js | Transform and filter records |
Fan Out | valueTransform.js , topicTransform.js | Route records to multiple topics |
Enrich (Async) | valueTransform.js | Async data enrichment |
Un-nesting | valueTransform.js | Flatten nested objects |
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
Opensrc/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:4. Build and Test
transforms/
directory.
5. Deploy to Streamkap
Coming soon: deploy using CLI , deploy using Terraform.- Create your transform in the Streamkap web interface
- Go to the Implementation tab
- 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)
- Always required:
- Paste into Streamkap’s code editor (this replaces the default code)
- Save and Deploy - your TypeScript code is now running!
🤔 Which File to Use?
Transform Type | File to Copy | Purpose |
---|---|---|
map_filter | valueTransform.js (required) | Transform and filter records |
keyTransform.js (optional) | Leave blank in Streamkap if no key changes needed | |
fan_out | valueTransform.js (required) | Transform records for routing |
topicTransform.js (optional) | Leave blank in Streamkap if no topic changes needed | |
enrich_async | valueTransform.js (required) | Enrich with external APIs |
un_nesting | valueTransform.js (required) | Flatten nested objects |
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 keytopicTransform.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
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:4. Build & Deploy
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: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?- 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.