Connect to event tracking platforms like PostHog using Metadapter Event and create event tracking endpoints for SherpaJS an agnostic and modular serverless platform.
Caution
Vercel doesn't support AJV regularly, we are working on a fix, but as of now, validation doesn't work on Vercel.
- ✅ SherpaJS Module, an Agnostic and Modular Serverless Platform
- ✅ Log event using Metadapter Event
- ✅ Supports PostHog
npm install sherpajs-events
Services are loaded using Metadapter Event. The id
is the eventID that is logged with your event platform. The schema
is optional, but uses AJV schema.
// sherpa.server.ts
import Events, { Service, ServiceType } from "sherpajs-events";
export default Events.load({
service: Service(ServiceType.Skeleton, undefined),
events: {
"test": {
id: "test",
schema: {
type: "object",
properties: {
foo: {type: "integer"},
bar: {type: "string"}
},
required: ["foo"],
additionalProperties: false
}
},
"test2": {
id: "test2"
}
}
});
Body
{
"foo": true
}
Response
400 Bad Request
Property 'foo': must be integer
Body
Hello World
Response
400 Bad Request
Request body must be in JSON format.
Body
{
"foo": 3,
"bar": "hello world"
}
Response
201 Created
Successfully Logged Event
Body
{
"test": "hello world",
}
Response
201 Created
Successfully Logged Event
Body
{
"test": true,
}
Response
201 Created
Successfully Logged Event