---
title: "Getting started"
description: "Create an account, configure the SQLStyle CLI, and open a local database through the SDK."
section: "Start"
source_url: "https://sqlstyle.com/docs/getting-started"
---
The SQLStyle SDK opens a local database while SQLStyle coordinates the writer,
live replicas, and recovery.

> SQLStyle does not publish an uptime commitment or claim a formal compliance certification. Keep an independent recovery path for critical data.

## 1. Create and authenticate an account

Create an account at [sqlstyle.com/account](https://sqlstyle.com/account). Then authenticate the CLI:

```sh
sqlstyle auth login
sqlstyle auth status
```

Browser login stores an account-scoped CLI credential in the selected local credential store. The web dashboard handles signup and billing; database, storage-profile, API-key, restore, and analytics workflows remain in the CLI.

## 2. Create service resources

Create a non-secret storage profile:

```sh
sqlstyle storage profiles create \
  --name production \
  --provider aws_s3 \
  --bucket app-dbh \
  --region us-east-1 \
  --access-key-id "$AWS_ACCESS_KEY_ID"
```

Create a logical database and a database-scoped runtime key:

```sh
sqlstyle database app/main create --write-allowance 100 \
  --storage-profile-id <profile-id>

sqlstyle keys create \
  --database app/main \
  --label application-runtime
```

The key command prints the secret once by default. Store it in the application's secret manager.

## 3. Ship the runtime and SDK

A Node.js release is expected to pair the SDK package with the SQLStyle runtime:

```text
app/
  node_modules/@sqlstyle/database/
  vendor/sqlstyle/
    include/sqlstyle.h
    lib/libsqlstyle.so.1
```

The SQLStyle artifact supplies ABI v2 through its uniquely named library. Keep
the runtime and SDK on the same release-qualified version set.

## 4. Open the database

```js
import { DatabaseSync } from "@sqlstyle/database";

const db = new DatabaseSync("app.db", {
  sqlstyle: {
    name: "app/main",
    apiKey: process.env.SQLSTYLE_API_KEY,
    storage: {
      secretAccessKey: process.env.SQLSTYLE_STORAGE_SECRET_ACCESS_KEY,
    },
  },
});

try {
  console.log(db.prepare("select authority from sqlstyle_status").get());
} finally {
  db.close();
}
```

`DatabaseSync` follows the synchronous `node:sqlite` shape. SQLStyle adds
managed database configuration while statements and rows remain ordinary
SQLite operations.

## 5. Check write authority

Query the SQL surface through the returned connection:

```sql
SELECT authority FROM sqlstyle_status;
```

Only `held` admits writes. Treat `unheld` as read-only.

## Next steps

- Start with the [architecture section](/docs/architecture) before designing a topology.
- Learn how [Application Stored Procedures](/docs/application-stored-procedures) follow the current primary.
- Configure [object storage](/docs/object-storage) for portable recovery.
- Review [status and SQL surfaces](/docs/status-and-sql-surfaces).
- Use [restore and recovery](/docs/restore-and-recovery) before relying on a backup policy.