import { CodeBlock } from "../CodeBlock/CodeBlock"; export const HTTPManual: React.FC<{ domain: string; writeKey?: string }> = ({ domain, writeKey }) => { return (
You can use server to server API to send data to Jitsu. This is useful if you want to send data from your backend.
In case of using HTTP API you may need to manually ad user's IP address and User Agent to the event.
This endpoint can be used to send events to Jitsu from user devices or browsers:
{`${domain}/api/s/{event-type}`}
event-type could be:
page, track, identify or group
event as event_type if you want server to take actual event type from{" "}
type field of the event payload
The endpoint accepts POST requests with events payload in JSON format.
This endpoint can be used to send events to Jitsu from servers:
{`${domain}/api/s/s2s/{event-type}`}
event-type could be:
page, track, identify or group
event as event_type if you want server to take actual event type from{" "}
type field of the event payload
The endpoint accepts POST requests with events payload in JSON format. Pay attention to s2s part
of the URL.
The presence of this part indicates that the event is sent from server-to-server. Unlike browser events, s2s
events are processed differently:
X-Write-Key is mandatory, and the header should contain server write key of the
site
context.ip and context.userAgent are not extracted from the request headers, but
should be passed explicitly in the event payload
context.ip is not present, the ip field will be empty to avoid confusion; same applies for{" "}
context.userAgent
Send track event: