A scalable backend powered by your ambitions
Our intuitive backend platform empowers you to build sophisticated production apps in minutes instead of months. Eliminate infrastructure hassles so you can focus on creating innovative features.
Harness the power of AI and large language models (LLMs) for intelligent automation and advanced functionalities. Integrate Retrieval-Augmented Generation (RAG) for enhanced data retrieval and personalized user experiences.
Transform your app development process with cutting-edge technologies and focus on delivering unique, value-driven applications.
import createClient from '@singlebase/singlebase-js'
const API_KEY = "[[my-api-key]]"
const singlebase = createClient({ api_key: API_KEY })
//--- Create a user
const { data, error } = await singlebase
.auth
.createUserWithPassword({
email: 'user@singlebase',
password: 'secureAW3s0meP@55w0rd_',
display_name: 'SinglebaseCloud'
})
if (data) {
console.log(`Welcome ${data?.display_name} back`)
} else {
console.error('Unable to login. Try again later')
}
//--- Insert document
const { data, error } = await singlebase
.collection('articles')
.insert({
title: 'Hello SinglebaseCloud',
content: 'How are you doing?',
is_draft: true
})
//--- Insert vectors
const { data, error } = await singlebase
.collection('articles')
.insert({
title: 'Hello SinglebaseCloud',
content: 'How are you doing?',
vector: [0.2, 0.3, 0.1]
})
//--- Vector search
const { data, error } = await singlebase
.collection('articles')
.search({
vector: [0.1, 0.5, 0.4]
})
if (data) {
for (const doc of data) {
console.log(`ID: ${doc?._key} - Title: ${doc?.title}`)
}
}
//--- Upload file
/**
* HTML
* <input id="file" type="file" />
*/
const file = document.getElementById("file").files[0];
const { data, error } = await singlebase
.file
.upload(file, {title: "My Awesome Picture"})
if (data) {
console.log(`File title: ${data?.title} `)
}
//--- With X-SQL
const docs = await singlebase
.query(`
SELECT _key, title, content
FROM articles
WHERE $where
SORT BY _created_at
DESC LIMIT 10`, {
variables: {
where: {
categories: "blog"
}
}
}
)
Connect, build, and scale with ease
VectorDB, Relational Document DB, Auth, Storage, all accessible via GraphQL, SQL, and REST
Start building your next AI+ project with unlimited usage for Vector DB, Relational Document DB, Search, Auth, Storage.
Start Building