Python
# To use the Python SDK, install the package:
# pip install memobase
from memobase import MemoBaseClient
memobase = MemoBaseClient(project_url='PROJECT_URL', api_key='PROJECT_TOKEN')
assert memobase.ping()// To use the JavaScript SDK, install the package:
// npm install @memobase/memobase
import { MemoBaseClient } from '@memobase/memobase';
const client = new MemoBaseClient(process.env.MEMOBASE_PROJECT_URL, process.env.MEMOBASE_API_KEY);
await client.ping();
// To use the Go SDK, install the package:
// go get github.com/memodb-io/memobase/src/client/memobase-go@latest
import (
"fmt"
"log"
"github.com/memodb-io/memobase/src/client/memobase-go/core"
)
func main() {
projectURL := "YOUR_PROJECT_URL"
apiKey := "YOUR_API_KEY"
// Initialize the client
client, err := core.NewMemoBaseClient(
projectURL,
apiKey,
)
if err != nil {
log.Fatalf("Failed to create client: %v", err)
}
// Ping the server
if !client.Ping() {
log.Fatal("Failed to connect to server")
}
fmt.Println("Successfully connected to server")
}
curl --request GET \
--url https://api.memobase.dev/api/v1/healthcheck<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.memobase.dev/api/v1/healthcheck",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.memobase.dev/api/v1/healthcheck")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.memobase.dev/api/v1/healthcheck")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"data": {},
"errno": 0,
"errmsg": ""
}Project
Health Check
Check if your memobase is set up correctly
GET
/
api
/
v1
/
healthcheck
Python
# To use the Python SDK, install the package:
# pip install memobase
from memobase import MemoBaseClient
memobase = MemoBaseClient(project_url='PROJECT_URL', api_key='PROJECT_TOKEN')
assert memobase.ping()// To use the JavaScript SDK, install the package:
// npm install @memobase/memobase
import { MemoBaseClient } from '@memobase/memobase';
const client = new MemoBaseClient(process.env.MEMOBASE_PROJECT_URL, process.env.MEMOBASE_API_KEY);
await client.ping();
// To use the Go SDK, install the package:
// go get github.com/memodb-io/memobase/src/client/memobase-go@latest
import (
"fmt"
"log"
"github.com/memodb-io/memobase/src/client/memobase-go/core"
)
func main() {
projectURL := "YOUR_PROJECT_URL"
apiKey := "YOUR_API_KEY"
// Initialize the client
client, err := core.NewMemoBaseClient(
projectURL,
apiKey,
)
if err != nil {
log.Fatalf("Failed to create client: %v", err)
}
// Ping the server
if !client.Ping() {
log.Fatal("Failed to connect to server")
}
fmt.Println("Successfully connected to server")
}
curl --request GET \
--url https://api.memobase.dev/api/v1/healthcheck<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.memobase.dev/api/v1/healthcheck",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.memobase.dev/api/v1/healthcheck")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.memobase.dev/api/v1/healthcheck")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"data": {},
"errno": 0,
"errmsg": ""
}Check if your memobase server is set up correctly and all required services (database, Redis) are available and functioning properly.
⌘I