⚡ ⚡ Learn how Investing.com uses Jitsu to move data faster
Learn more
Jitsu FunctionsUnlock the full potential of your data
Website
Web app
HTTP API
function.js
export default async function(event, { log, props, store }) {
if (event.type === "identify") {
if (await store.set(`signup/${event.traits.email}`)) {
log(`User ${event.traits.email} already signed up`);
} else {
await store.set(`signup/${event.traits.email}`, true);
await fetch(`https://slack.com/api/chat.postMessage`, {
method: "POST",
body: JSON.stringify({
token: props.SLACK_TOKEN,
channel: props.CHANNEL_ID,
text: `Hooray! We have new user ${event.traits.email}`
})
});
}
}
}
Warehouse
Webhook
Cloud
Free for up to 200k events
No credit card required
./transform.js
async function transform(event, { log, props, store }) {
if (event.type === "page_view") {
event.type = "page";
}
if (event.userId === "integration-tests") {
return;
}
}
export default transform;
Transform
Transform your incoming data with Javascript. Fix malformed events, rename fields or filter out unwanted data.
function.js
export default async function(event, { log, props, store }) {
let profile = {};
let uid = event.userId;
if (uid) {
const res = await fetch(`${props.USER_SERVICE}/${uid}`);
profile = res.json();
}
event.traits = {...event.traits, ...profile};
await fetch(`https://eventq.service.com`, {
method: "POST",
body: JSON.stringify(event),
})
}
Call APIs
Jitsu Functions Runtime includes a complete Fetch API, allowing easy connection to outside services for enhancing data or sending data to various locations.
function.js
export default async function(event, { log, props, store }) {
if (!event.type === "identify" || !event.userId) {
return;
}
const secondLogin = await store.get(`first_login/${event.userId}`);
if (!secondLogin) {
event.properties.firstLogin = true;
await store.set(`first_login/${event.userId}`, true);
}
}
Persist
Make your function stateful by using embedded key-value storage. Cache data, or store user preferences
function.js
import lodash from 'lodash';
function fixEvent(event) {
return lodash.omit(event, "server-id", "auth-token");
}
export default fixEvent;
Use librariesComing soon
Use Javascript ecosystem in full, including imports of NPM libraries. Bundle you function with Jitsu CLI, and deploy it to the cloud in a few clicks.
vklmn@devbox:~/sample-function
❯ npx create-jitsu-app --name sample-function ✨ Creating a new Jitsu app... 🚀 Installing packages 👍 Success! Happy hacking! ❯ npm run build ❯ jitsu-cli login ❯ npm run deploy
DeployComing soon
With Jitsu CLI, you can deploy the functions to the cloud. Test modifications locally using the Jitsu testing toolkit before implementing them in production. Manage your code using your preferred tools and integrate with any CI/CD system as needed.