
Company News
Andrew Becherer Joins Socket as Chief Information Security Officer
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.
@tursodatabase/api
Advanced tools
The Turso API gives you everything needed to manage your organization and it's members, groups, databases, and API tokens.
Programmatically manage Turso Cloud databases.
npm install @tursodatabase/api
import { createClient } from "@tursodatabase/api";
const turso = createClient({
org: "", // Your personal account or organization slug
token: "...",
});
const organizations = await turso.organizations.list();
const orgMembers = await turso.organizations.update({ overages: true });
const orgMembers = await turso.organizations.delete();
const orgMembers = await turso.organizations.members();
const orgMembers = await turso.organizations.addMember("username", "admin");
const orgMembers = await turso.organizations.removeMember("username");
const invite = await turso.organizations.inviteUser(
"jamie@turso.tech",
"admin"
);
await turso.organizations.deleteInvite("jamie@turso.tech");
const invoices = await turso.organizations.invoices();
const locations = await turso.locations.list();
const closest = await turso.locations.closest();
const groups = await turso.groups.list();
const group = await turso.groups.get("default");
const group = await turso.groups.create("customgroup", "lhr");
const group = await turso.groups.delete("customgroup");
const token = await turso.groups.createToken("default");
const token = await turso.groups.createToken("default", {
expiration: "1w2d6h3m",
authorization: "full-access",
});
const token = await turso.groups.createToken("default", {
permissions: {
read_attach: {
databases: ["db1", "db2"],
},
},
});
const token = await turso.groups.rotateTokens("default");
const tokens = await turso.apiTokens.list();
const token = await turso.apiTokens.create("superdupertokenname");
const token = await turso.apiTokens.revoke("superdupertokenname");
const token = await turso.apiTokens.validate("token");
const database = await turso.databases.list();
const database = await turso.databases.list({
group: "group-name", // Filter by group
});
const database = await turso.databases.get("my-db");
const database = await turso.databases.create("db-name");
const database = await turso.databases.create("db-name", {
group: "my-group",
});
const database = await turso.databases.create("db-name", {
group: "my-group",
seed: {
type: "database",
name: "my-existing-db",
},
});
const database = await turso.databases.create("db-name", {
group: "my-group",
seed: {
type: "database",
name: "my-existing-db",
timestamp: "2021-01-01T00:00:00Z", // or new Date("2021-01-01T00:00:00Z")
},
});
const database = await turso.databases.create("parent-db", {
is_schema: true,
});
const database = await turso.databases.create("child-db", {
schema: "parent-db",
});
const database = await turso.databases.delete("my-db");
const token = await turso.databases.createToken("my-db");
const token = await turso.databases.createToken("my-db", {
expiration: "1w2d6h3n",
authorization: "full-access",
});
const token = await turso.databases.rotateTokens("my-db");
const usageStatsWithDate = await turso.databases.usage("my-db");
const usageStatsWithDate = await turso.databases.usage("my-db", {
from: new Date("2023-01-01"),
to: new Date("2023-02-01"),
});
// Using ISOStrings
const usageStatsWithString = await turso.databases.usage("my-db", {
from: "2023-01-01T00:00:00Z",
to: "2023-02-01T00:00:00Z",
});
MIT
FAQs
The Turso API gives you everything needed to manage your organization and it's members, groups, databases, and API tokens.
The npm package @tursodatabase/api receives a total of 8,493 weekly downloads. As such, @tursodatabase/api popularity was classified as popular.
We found that @tursodatabase/api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.

Company News
Replit is integrating Socket Firewall into its AI-powered development experience to help protect builders from malicious open source packages.

Security News
npm confirmed a tooling bug incorrectly marked several one-character packages as security holders and said it was working on a rollback.