Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions client-sdk-references/capacitor.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import SdkFeatures from '/snippets/sdk-features.mdx';
import CapacitorInstallation from '/snippets/capacitor/installation.mdx';
import JavaScriptAsyncWatch from '/snippets/basic-watch-query-javascript-async.mdx';
import JavaScriptCallbackWatch from '/snippets/basic-watch-query-javascript-callback.mdx';
import GenerateSchemaAutomatically from '/snippets/generate-schema-automatically.mdx';

<CardGroup cols={2}>
<Card title="PowerSync SDK on NPM" icon="npm" href="https://www.npmjs.com/package/@powersync/capacitor">
Expand Down Expand Up @@ -63,13 +64,7 @@ The first step is defining the schema for the local SQLite database.

This schema represents a "view" of the downloaded data. No migrations are required — the schema is applied directly when the local PowerSync database is constructed (as we'll show in the next step).

<Info>
**Generate schema automatically**

In the [dashboard](/usage/tools/powersync-dashboard), the schema can be generated based off your sync rules by right-clicking on an instance and selecting **Generate client-side schema**.

Similar functionality exists in the [CLI](/usage/tools/cli).
</Info>
<GenerateSchemaAutomatically />

The types available are `text`, `integer` and `real`. These should map directly to the values produced by the [Sync Rules](/usage/sync-rules). If a value doesn't match, it is cast automatically. For details on how Postgres types are mapped to the types below, see the section on [Types](/usage/sync-rules/types) in the _Sync Rules_ documentation.

Expand Down
4 changes: 4 additions & 0 deletions client-sdk-references/dotnet.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import DotNetInstallation from '/snippets/dotnet/installation.mdx';
import DotNetWatch from '/snippets/dotnet/basic-watch-query.mdx';
import GenerateSchemaAutomatically from '/snippets/generate-schema-automatically.mdx';

<CardGroup>
<Card title="PowerSync SDK on NuGet" icon="nuget" href="https://www.nuget.org/packages/PowerSync.Common/">
Expand Down Expand Up @@ -39,7 +40,7 @@
* **WPF**: Windows desktop applications

**Current Limitations**:
* Blazor (web) platforms are not yet supported.

Check warning on line 43 in client-sdk-references/dotnet.mdx

View check run for this annotation

Mintlify / Mintlify Validation (powersync) - vale-spellcheck

client-sdk-references/dotnet.mdx#L43

Did you really mean 'Blazor'?

For more details, please refer to the package [README](https://github.com/powersync-ja/powersync-dotnet/tree/main?tab=readme-ov-file).

Expand All @@ -64,6 +65,9 @@
The first step is defining the schema for the local SQLite database.

This schema represents a "view" of the downloaded data. No migrations are required — the schema is applied directly when the local PowerSync database is constructed (as we'll show in the next step).

<GenerateSchemaAutomatically />

You can use [this example](https://github.com/powersync-ja/powersync-dotnet/blob/main/demos/CommandLine/AppSchema.cs) as a reference when defining your schema.

### 2. Instantiate the PowerSync Database
Expand Down Expand Up @@ -155,7 +159,7 @@

public class MyConnector : IPowerSyncBackendConnector
{
private readonly HttpClient _httpClient;

Check warning on line 162 in client-sdk-references/dotnet.mdx

View check run for this annotation

Mintlify / Mintlify Validation (powersync) - vale-spellcheck

client-sdk-references/dotnet.mdx#L162

Did you really mean 'readonly'?

Check warning on line 162 in client-sdk-references/dotnet.mdx

View check run for this annotation

Mintlify / Mintlify Validation (powersync) - vale-spellcheck

client-sdk-references/dotnet.mdx#L162

Did you really mean '_httpClient'?

// User credentials for the current session
public string UserId { get; private set; }
Expand Down
10 changes: 2 additions & 8 deletions client-sdk-references/flutter.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ sidebarTitle: Overview
import SdkFeatures from '/snippets/sdk-features.mdx';
import FlutterInstallation from '/snippets/flutter/installation.mdx';
import FlutterWatch from '/snippets/flutter/basic-watch-query.mdx';
import GenerateSchemaAutomatically from '/snippets/generate-schema-automatically.mdx';

<CardGroup>
<Card title="PowerSync SDK on pub.dev" icon="cube" href="https://pub.dev/packages/powersync">
Expand Down Expand Up @@ -74,14 +75,7 @@ The first step is defining the schema for the local SQLite database. This will b

This schema represents a "view" of the downloaded data. No migrations are required — the schema is applied directly when the PowerSync database is constructed.

<Info>
**Generate schema automatically**

In the [dashboard](/usage/tools/powersync-dashboard), the schema can be generated based on your sync rules by right-clicking on an instance and selecting **Generate client-side schema**.

Similar functionality exists in the [CLI](/usage/tools/cli).

</Info>
<GenerateSchemaAutomatically />
The types available are `text`, `integer` and `real`. These should map directly to the values produced by the [Sync Rules](/usage/sync-rules). If a value doesn't match, it is cast automatically. For details on how Postgres types are mapped to the types below, see the section on [Types](/usage/sync-rules/types) in the _Sync Rules_ documentation.

**Example**:
Expand Down
9 changes: 2 additions & 7 deletions client-sdk-references/javascript-web.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import SdkFeatures from '/snippets/sdk-features.mdx';
import JavaScriptWebInstallation from '/snippets/javascript-web/installation.mdx';
import JavaScriptAsyncWatch from '/snippets/basic-watch-query-javascript-async.mdx';
import JavaScriptCallbackWatch from '/snippets/basic-watch-query-javascript-callback.mdx';
import GenerateSchemaAutomatically from '/snippets/generate-schema-automatically.mdx';

<CardGroup cols={2}>
<Card title="PowerSync SDK on NPM" icon="npm" href="https://www.npmjs.com/package/@powersync/web">
Expand Down Expand Up @@ -59,13 +60,7 @@ The first step is defining the schema for the local SQLite database.

This schema represents a "view" of the downloaded data. No migrations are required — the schema is applied directly when the local PowerSync database is constructed (as we'll show in the next step).

<Info>
**Generate schema automatically**

In the [dashboard](/usage/tools/powersync-dashboard), the schema can be generated based off your sync rules by right-clicking on an instance and selecting **Generate client-side schema**.

Similar functionality exists in the [CLI](/usage/tools/cli).
</Info>
<GenerateSchemaAutomatically />

The types available are `text`, `integer` and `real`. These should map directly to the values produced by the [Sync Rules](/usage/sync-rules). If a value doesn't match, it is cast automatically. For details on how Postgres types are mapped to the types below, see the section on [Types](/usage/sync-rules/types) in the _Sync Rules_ documentation.

Expand Down
3 changes: 3 additions & 0 deletions client-sdk-references/kotlin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import SdkFeatures from '/snippets/sdk-features.mdx';
import KotlinInstallation from '/snippets/kotlin/installation.mdx';
import KotlinWatch from '/snippets/kotlin/basic-watch-query.mdx';
import GenerateSchemaAutomatically from '/snippets/generate-schema-automatically.mdx';

<CardGroup>
<Card title="PowerSync SDK on Maven Central" icon="/logo/maven.svg" href="https://central.sonatype.com/artifact/com.powersync/core">
Expand Down Expand Up @@ -48,6 +49,8 @@

The first step is defining the schema for the local SQLite database, which is provided to the `PowerSyncDatabase` constructor via the `schema` parameter. This schema represents a "view" of the downloaded data. No migrations are required — the schema is applied directly when the PowerSync database is constructed.

<GenerateSchemaAutomatically />

The types available are `text`, `integer` and `real`. These should map directly to the values produced by the [Sync Rules](/usage/sync-rules). If a value doesn't match, it is cast automatically.

**Example**:
Expand Down Expand Up @@ -336,7 +339,7 @@
- Most upcoming features will not be ported to this implementation, and we intend to remove it eventually.
2. **Rust (currently experimental)**
- This is a newer implementation, mostly implemented in Rust but still using Kotlin for networking.
- Apart from newer features, this implementation is also more performant.

Check warning on line 342 in client-sdk-references/kotlin.mdx

View check run for this annotation

Mintlify / Mintlify Validation (powersync) - vale-spellcheck

client-sdk-references/kotlin.mdx#L342

Did you really mean 'performant'?
- We [encourage interested users to try it out](https://releases.powersync.com/announcements/improved-sync-performance-in-our-client-sdks)
and report feedback, as we intend to make it the default after a stabilization period.

Expand Down
8 changes: 2 additions & 6 deletions client-sdk-references/node.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
import NodeInstallation from '/snippets/node/installation.mdx';
import JavaScriptAsyncWatch from '/snippets/basic-watch-query-javascript-async.mdx';
import JavaScriptCallbackWatch from '/snippets/basic-watch-query-javascript-callback.mdx';
import GenerateSchemaAutomatically from '/snippets/generate-schema-automatically.mdx';

<Note>
This page describes the PowerSync _client_ SDK for Node.js.

Check warning on line 14 in client-sdk-references/node.mdx

View check run for this annotation

Mintlify / Mintlify Validation (powersync) - vale-spellcheck

client-sdk-references/node.mdx#L14

Did you really mean '_client_'?
If you're interested in using PowerSync for your Node.js backend, no special package is required.
Instead, follow our guides on [app backend setup](/installation/app-backend-setup).
</Note>
Expand Down Expand Up @@ -57,15 +58,10 @@
This schema represents a "view" of the downloaded data. No migrations are required — the schema is applied directly when the local PowerSync database is constructed (as we'll show in the next step).
You can use [this example](https://github.com/powersync-ja/powersync-js/blob/e5a57a539150f4bc174e109d3898b6e533de272f/demos/example-node/src/powersync.ts#L47-L77) as a reference when defining your schema.

<Info>
**Generate schema automatically**
<GenerateSchemaAutomatically />

In the [dashboard](/usage/tools/powersync-dashboard), the schema can be generated based off your sync rules by right-clicking on an instance and selecting **Generate client-side schema**.
Select JavaScript and replace the suggested import with `@powersync/node`.

Similar functionality exists in the [CLI](/usage/tools/cli).
</Info>

### 2. Instantiate the PowerSync Database

Next, you need to instantiate the PowerSync database — this is the core managed database.
Expand Down Expand Up @@ -243,7 +239,7 @@
```

When opening the database, instruct PowerSync to use the custom worker.
Also use the `initializeConnection` option to install an ecryption key:

Check warning on line 242 in client-sdk-references/node.mdx

View check run for this annotation

Mintlify / Mintlify Validation (powersync) - vale-spellcheck

client-sdk-references/node.mdx#L242

Did you really mean 'ecryption'?

```Typescript
const encryptionKey = 'todo: generate encryption key and store it safely';
Expand All @@ -270,9 +266,9 @@
```

<Note>
If you're using a custom compilation toolchain, for instance because you're compiling from TypeScript

Check warning on line 269 in client-sdk-references/node.mdx

View check run for this annotation

Mintlify / Mintlify Validation (powersync) - vale-spellcheck

client-sdk-references/node.mdx#L269

Did you really mean 'toolchain'?
or are applying a bundler to your project, loading workers may require additional configuration on that

Check warning on line 270 in client-sdk-references/node.mdx

View check run for this annotation

Mintlify / Mintlify Validation (powersync) - vale-spellcheck

client-sdk-references/node.mdx#L270

Did you really mean 'bundler'?
toolchain.

Check warning on line 271 in client-sdk-references/node.mdx

View check run for this annotation

Mintlify / Mintlify Validation (powersync) - vale-spellcheck

client-sdk-references/node.mdx#L271

Did you really mean 'toolchain'?
</Note>

### `node:sqlite`
Expand Down
9 changes: 2 additions & 7 deletions client-sdk-references/react-native-and-expo.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import SdkFeatures from '/snippets/sdk-features.mdx';
import ReactNativeInstallation from '/snippets/react-native/installation.mdx';
import JavaScriptAsyncWatch from '/snippets/basic-watch-query-javascript-async.mdx';
import JavaScriptCallbackWatch from '/snippets/basic-watch-query-javascript-callback.mdx';
import GenerateSchemaAutomatically from '/snippets/generate-schema-automatically.mdx';

<CardGroup>
<Card title="PowerSync SDK on NPM" icon="npm" href="https://www.npmjs.com/package/@powersync/react-native">
Expand Down Expand Up @@ -47,13 +48,7 @@ The first step is defining the schema for the local SQLite database.

This schema represents a "view" of the downloaded data. No migrations are required — the schema is applied directly when the PowerSync database is constructed (as we'll show in the next step).

<Info>
**Generate schema automatically**

In the [dashboard](/usage/tools/powersync-dashboard), the schema can be generated based off your sync rules by right-clicking on an instance and selecting **Generate client-side schema**.

Similar functionality exists in the [CLI](/usage/tools/cli).
</Info>
<GenerateSchemaAutomatically />

The types available are `text`, `integer` and `real`. These should map directly to the values produced by the [Sync Rules](/usage/sync-rules). If a value doesn't match, it is cast automatically. For details on how Postgres types are mapped to the types below, see the section on [Types](/usage/sync-rules/types) in the _Sync Rules_ documentation.

Expand Down
3 changes: 3 additions & 0 deletions client-sdk-references/swift.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ sidebarTitle: "Overview"
import SdkFeatures from '/snippets/sdk-features.mdx';
import SwiftInstallation from '/snippets/swift/installation.mdx';
import SwiftWatch from '/snippets/swift/basic-watch-query.mdx';
import GenerateSchemaAutomatically from '/snippets/generate-schema-automatically.mdx';

<CardGroup cols={3}>
<Card title="Source Code" icon="github" href="https://github.com/powersync-ja/powersync-swift/">
Expand Down Expand Up @@ -45,6 +46,8 @@ Before implementing the PowerSync SDK in your project, make sure you have comple

The first step is defining the schema for the local SQLite database, which is provided to the `PowerSyncDatabase` constructor via the `schema` parameter. This schema represents a "view" of the downloaded data. No migrations are required — the schema is applied directly when the PowerSync database is constructed.

<GenerateSchemaAutomatically />

The types available are `text`, `integer` and `real`. These should map directly to the values produced by the [Sync Rules](/usage/sync-rules). If a value doesn't match, it is cast automatically.

**Example**:
Expand Down
Binary file removed images/installation/copy-instance-url.png
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed images/installation/overview-sync-rules.png
Binary file not shown.
Binary file added images/usage/tools/dashboard-add-instance.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/usage/tools/dashboard-connect-button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/usage/tools/dashboard-create-project.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/usage/tools/dashboard-org-level.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion installation/authentication-setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
| **Auth0** | `https://{auth0-domain}/.well-known/jwks.json` | JWT Audience: PowerSync instance URL | [Auth0 Setup](/installation/authentication-setup/auth0) |
| **Clerk** | `https://{yourClerkDomain}/.well-known/jwks.json` |Additional configuration may be required | [Clerk Documentation](https://clerk.com/docs/backend-requests/making/jwt-templates#create-a-jwt-template) |
| **Stytch** | `https://{live_or_test}.stytch.com/v1/sessions/jwks/{project-id}` | Additional configuration may be required | [Stytch Documentation](https://stytch.com/docs/api/jwks-get) |
| **Keycloak** | `https://{your-keycloak-domain}/auth/realms/{realm-name}/protocol/openid-connect/certs` | Additional configuration may be required | [Keycloak Documentation](https://documentation.cloud-iam.com/how-to-guides/configure-remote-jkws.html) |

Check warning on line 50 in installation/authentication-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (powersync) - vale-spellcheck

installation/authentication-setup.mdx#L50

Did you really mean 'Keycloak'?
| **Amazon Cognito** | `https://cognito-idp.{region}.amazonaws.com/{userPoolId}/.well-known/jwks.json` | Additional configuration may be required | [Cognito Documentation](https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-using-tokens-verifying-a-jwt.html) |

Check warning on line 51 in installation/authentication-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (powersync) - vale-spellcheck

installation/authentication-setup.mdx#L51

Did you really mean 'Cognito'?
| **Azure AD** | `https://login.microsoftonline.com/{tenantId}/discovery/v2.0/keys` | Additional configuration may be required | [Azure AD Documentation](https://learn.microsoft.com/en-us/entra/identity-platform/access-tokens) |
| **Google Identity** | `https://www.googleapis.com/oauth2/v3/certs` | Additional configuration may be required | [Google Identity Documentation](https://developers.google.com/identity/openid-connect/openid-connect#discovery) |
| **SuperTokens** | `https://{YOUR_SUPER_TOKENS_CORE_CONNECTION_URI}/.well-known/jwks.json` | Additional configuration may be required | [SuperTokens Documentation](https://supertokens.com/docs/quickstart/integrations/aws-lambda/session-verification/using-jwt-authorizer) |
Expand All @@ -61,4 +61,4 @@

For others, some backend code must be added to your application backend to generate the JWTs needed for PowerSync — see [Custom](/installation/authentication-setup/custom) authentication.

For a quick way to get up and running during development, you can generate [Development Tokens](/installation/authentication-setup/development-tokens) directly from the [PowerSync Dashboard](/usage/tools/powersync-dashboard) (PowerSync Cloud) or locally with a self-hosted setup.
For a quick way to get up and running during development, you can generate [Development Tokens](/installation/authentication-setup/development-tokens) directly from the [PowerSync Dashboard](https://dashboard.powersync.com/) (PowerSync Cloud) or [locally](/tutorials/self-host/generate-dev-token) with a self-hosted setup.
2 changes: 1 addition & 1 deletion installation/authentication-setup/custom.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Requirements for the signed JWT:
1. The JWT must be signed using a key in the JWKS URL.
2. JWT must have a `kid` matching the key in the JWKS URL.
3. The `aud` of the JWT must match the PowerSync instance URL.
1. To get the instance URL of a PowerSync instance when using PowerSync Cloud: In the project tree on the [PowerSync dashboard](https://powersync.journeyapps.com/), click on the "Copy instance URL" icon.
1. To get the instance URL when using PowerSync Cloud: In the [PowerSync Dashboard](https://dashboard.powersync.com/), click **Connect** in the top bar and copy the instance URL from the dialog.
2. Alternatively, specify a custom audience in the instance settings.
4. The JWT must expire in 60 minutes or less. Specifically, both `iat` and `exp` fields must be present, with a difference of 3600 or less between them.
5. The user ID must be used as the `sub` of the JWT.
Expand Down
24 changes: 4 additions & 20 deletions installation/authentication-setup/development-tokens.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,10 @@ PowerSync allows generating temporary development tokens for authentication. Thi

### PowerSync Cloud - Dashboard:

1. **Enable setting**: The "Enable development tokens" setting must be set on the PowerSync instance. It can be set in the instance's config (In the [PowerSync dashboard](https://powersync.journeyapps.com/): Edit instance -> _Client Auth_).

<Frame>
<img src="/images/usage-17.avif"/>
</Frame>

1. **Generate token**: Call the "Generate development token" action for your instance. In the [PowerSync dashboard](https://powersync.journeyapps.com/), this can be done via the command palette (CMD+SHIFT+P / SHIFT+SHIFT), or by selecting it from an instance's options (right-click on an instance for options).

<Frame>
<img src="/images/usage-18.avif"/>
</Frame>


1. Enter token subject / user ID: This is the ID of the user you want to authenticate and is used in [sync rules](/usage/sync-rules) as `request.user_id()` (previously, `token_parameters.user_id`)

<Frame>
<img src="/images/usage-19.avif"/>
</Frame>

1. Copy the generated token. Note that these tokens expire after 12 hours.
1. **Enable setting**: The "Enable development tokens" setting must be set on the PowerSync instance. In the [PowerSync Dashboard](https://dashboard.powersync.com/), select your project and instance, go to the **Client Auth** view, and enable the "Enable development tokens" setting.
2. Next, click the **Connect** button in the top bar, and follow the instructions to generate a development token.
3. Enter the token subject / user ID: This is the ID of the user you want to authenticate and is used in [Sync Rules](/usage/sync-rules) as `request.user_id()`.
4. Click **Generate Token**. Copy the generated token. Note that these tokens expire after 12 hours.

### Self-hosted Setup / Local Development

Expand Down
20 changes: 10 additions & 10 deletions installation/authentication-setup/supabase-auth.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@ To implement either **Supabase Auth** or **Anonymous Sign-Ins**, enable the rele

### PowerSync Cloud instances:

1. In the PowerSync Dashboard, right-click on your instance to edit it.
1. In the [PowerSync Dashboard](https://dashboard.powersync.com/), select your project and instance and go to the **Client Auth** view.

2. Under the **"Client Auth"** tab, enable **"Use Supabase Auth"** and enter your Supabase **JWT Secret** (from the [JWT Keys](https://supabase.com/dashboard/project/_/settings/jwt) section in the Supabase dashboard):
2. Enable the **"Use Supabase Auth"** checkbox.

<Frame caption="Copy the secret from your Supabase project settings.">
<img src="/images/authentication/supabase-jwt-secret.png" />
</Frame>
3. Copy your JWT Secret from your Supabase project's settings ([JWT Keys](https://supabase.com/dashboard/project/_/settings/jwt) section in the Supabase dashboard).

<Frame caption="Enable Supabase Auth in your PowerSync instance settings and paste the secret.">
<img src="/images/authentication/use-supabase-auth.png" />
</Frame>
4. If your Supabase project uses the legacy JWT signing keys, paste the secret into the **"Supabase JWT Secret (optional) Legacy"** field. If you're using Supabase's new JWT signing keys, you can leave this field empty.

3. Click **"Save and deploy"** to deploy the updates to your instance.
5. Click **Save and Deploy** to apply the changes.

<Note>
PowerSync is compatible with Supabase's new [JWT signing keys](https://supabase.com/blog/jwt-signing-keys). If you're using the new keys, you don't need to provide the legacy JWT secret. See this [Discord thread](https://discord.com/channels/1138230179878154300/1194710422960472175/1396878076683485205) for details.
</Note>

### Self-hosted instances:

Expand All @@ -58,4 +58,4 @@ client_auth:

## Sync Rules

The Supabase user UUID will be available as `request.user_id()` in [Sync Rules](/usage/sync-rules). To use a different identifier as the user ID in sync rules (for example user email), use [Custom authentication](/installation/authentication-setup/custom).
The Supabase user UUID will be available as `request.user_id()` in [Sync Rules](/usage/sync-rules). To use a different identifier as the user ID in Sync Rules (for example user email), use [Custom authentication](/installation/authentication-setup/custom).
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The high-level approach is:
* Set the `SUB` field in the JWT payload to the user ID
* Pass this new JWT into your PowerSync `fetchCredentials` function

Use the below settings in your [PowerSync Dashboard](/usage/tools/powersync-dashboard):
Use the below settings in your [PowerSync Dashboard](https://dashboard.powersync.com/):

<Frame>
<img src="/images/usage-20.avif"/>
Expand Down
9 changes: 3 additions & 6 deletions installation/client-side-setup/define-your-schema.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,18 @@
title: "Define your Schema"
---

import GenerateSchemaAutomatically from '/snippets/generate-schema-automatically.mdx';

The PowerSync Client SDKs expose a managed SQLite database that your app can read from and write to. The client-side schema refers to the schema for that SQLite database.

The client-side schema is typically mainly derived from your backend database schema and [Sync Rules](/usage/sync-rules), but can also include other tables such as local-only tables.

Note that schema migrations are not required on the SQLite database due to the schemaless nature of the [PowerSync protocol](/architecture/powersync-protocol): schemaless data is synced to the client-side SQLite database, and the client-side schema is then applied to that data using _SQLite views_ to allow for structured querying of the data.

<Info>
**Generate schema automatically (PowerSync Cloud)**
<GenerateSchemaAutomatically />

In the [PowerSync Dashboard](/usage/tools/powersync-dashboard), the schema can be generated based off your [Sync Rules](/usage/sync-rules) by right-clicking on an instance and selecting **Generate client-side schema**.

Similar functionality exists in the PowerSync [CLI](/usage/tools/cli).

**Note:** The generated schema will exclude an `id` column, as the client SDK automatically creates an `id` column of type `text`. Consequently, it is not necessary to specify an `id` column in your schema. For additional information on IDs, refer to [Client ID](/usage/sync-rules/client-id).
</Info>

## Example implementation

Expand Down
Loading