Quickstart
Let's get started with Logsh!
Generate an API Key
API tokens help Logsh verify your identity
Click the button "+ Create API Key" and generate your first API key.
Create a Project
Logsh lets you make a project for each app you have. You can make as many as you like!
Click the button "+ Create new project" and give your project a name, like "Logsh"
Create your workspace ( project ) Create a Channel
Channels are like boxes for your events. You could have one for logins, another for payments, and so on.
Click the button "+ Create Channel" and give your channel a name, like "Users"
Send Your First Event
await fetch(
"https://api.logsh.co/api/v1/log",
{
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer <API_KEY>"
},
body: JSON.stringify({
project: "logsh",
icon: "🔥",
event: "Subscription created",
channel: "users",
userId: "user@example.com",
description: "New Subscription created",
notify: false,
metadata: {
plan : "premium",
cycle : "monthly",
trial : "false",
mrr : "19.95"
}
}),
}
);
<?php
$apiUrl = "https://api.logsh.co/api/v1/log";
$apiKey = "<API_KEY>";
$data = [
"project" => "logsh",
"icon" => "🔥",
"event" => "Subscription created",
"channel" => "users",
"userId" => "user@example.com",
"description" => "New Subscription created",
"notify" => false,
"metadata" => [
"plan" => "premium",
"cycle" => "monthly",
"trial" => "false",
"mrr" => "19.95"
]
];
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => $apiUrl,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Authorization: Bearer " . $apiKey
],
CURLOPT_POSTFIELDS => json_encode($data)
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
import requests
import json
url = "https://api.logsh.co/api/v1/log"
payload = json.dumps({
"project": "logsh",
"icon": "🔥",
"event": "Subscription created",
"channel": "users",
"userId": "user@example.com",
"description": "New Subscription created",
"notify": False,
"metadata": {
"plan" : "premium",
"cycle" : "monthly",
"trial" : "false",
"mrr" : "19.95"
}
})
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer <API_KEY>'
}
response = requests.post(url, headers=headers, data=payload)
curl --location --request POST 'https://api.logsh.co/api/v1/log' \
--header 'Authorization: Bearer <API_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
"project": "logsh",
"icon": "🔥",
"event": "Subscription created",
"channel": "users",
"userId": "user@example.com",
"description": "New Subscription created",
"notify": False,
"metadata": {
"plan" : "premium",
"cycle" : "monthly",
"trial" : "false",
"mrr" : "19.95"
}
}'
Publish a event in Logsh.co
POST
https://api.logsh.co/api/v1/log
Headers
Body
Name
Type
Description
Required
User Who Realizes The Event
JSON
key : string
value : string
Response
{
"name": "validation_error",
"message": ""
}
{
"name": "missing_api_key",
"message": ""
}
{
"name": "invalid_api_Key",
"message": ""
}
{
"name": "not_found",
"message": ""
}
{
"name": "rate_limit_exceeded",
"message": ""
}