diff --git a/client-sdk-references/capacitor.mdx b/client-sdk-references/capacitor.mdx index 948d6b64..13e7e930 100644 --- a/client-sdk-references/capacitor.mdx +++ b/client-sdk-references/capacitor.mdx @@ -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'; @@ -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). - - **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). - + 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. diff --git a/client-sdk-references/dotnet.mdx b/client-sdk-references/dotnet.mdx index 89aa8056..3640324f 100644 --- a/client-sdk-references/dotnet.mdx +++ b/client-sdk-references/dotnet.mdx @@ -6,6 +6,7 @@ sidebarTitle: Overview import DotNetInstallation from '/snippets/dotnet/installation.mdx'; import DotNetWatch from '/snippets/dotnet/basic-watch-query.mdx'; +import GenerateSchemaAutomatically from '/snippets/generate-schema-automatically.mdx'; @@ -64,6 +65,9 @@ Next, make sure that you have: 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). + + + 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 diff --git a/client-sdk-references/flutter.mdx b/client-sdk-references/flutter.mdx index c48c0705..e165b243 100644 --- a/client-sdk-references/flutter.mdx +++ b/client-sdk-references/flutter.mdx @@ -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'; @@ -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. - -**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). - - + 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**: diff --git a/client-sdk-references/javascript-web.mdx b/client-sdk-references/javascript-web.mdx index c3d3ea2c..1766ba2e 100644 --- a/client-sdk-references/javascript-web.mdx +++ b/client-sdk-references/javascript-web.mdx @@ -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'; @@ -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). - - **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). - + 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. diff --git a/client-sdk-references/kotlin.mdx b/client-sdk-references/kotlin.mdx index 1c905987..3ec3f08f 100644 --- a/client-sdk-references/kotlin.mdx +++ b/client-sdk-references/kotlin.mdx @@ -6,6 +6,7 @@ sidebarTitle: Overview 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'; @@ -48,6 +49,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. + + 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**: diff --git a/client-sdk-references/node.mdx b/client-sdk-references/node.mdx index 5c5234f8..b71c794d 100644 --- a/client-sdk-references/node.mdx +++ b/client-sdk-references/node.mdx @@ -8,6 +8,7 @@ import SdkFeatures from '/snippets/sdk-features.mdx'; 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'; This page describes the PowerSync _client_ SDK for Node.js. @@ -57,15 +58,10 @@ 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). 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. - - **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**. Select JavaScript and replace the suggested import with `@powersync/node`. - Similar functionality exists in the [CLI](/usage/tools/cli). - - ### 2. Instantiate the PowerSync Database Next, you need to instantiate the PowerSync database — this is the core managed database. diff --git a/client-sdk-references/react-native-and-expo.mdx b/client-sdk-references/react-native-and-expo.mdx index f3075c4d..2ac8e7c9 100644 --- a/client-sdk-references/react-native-and-expo.mdx +++ b/client-sdk-references/react-native-and-expo.mdx @@ -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'; @@ -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). - -**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). - + 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. diff --git a/client-sdk-references/swift.mdx b/client-sdk-references/swift.mdx index 17d59f83..9159e245 100644 --- a/client-sdk-references/swift.mdx +++ b/client-sdk-references/swift.mdx @@ -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'; @@ -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. + + 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**: diff --git a/images/installation/copy-instance-url.png b/images/installation/copy-instance-url.png deleted file mode 100644 index 7d39fe66..00000000 Binary files a/images/installation/copy-instance-url.png and /dev/null differ diff --git a/images/installation/dashboard-supabase-connection.png b/images/installation/dashboard-supabase-connection.png new file mode 100644 index 00000000..70f36d2c Binary files /dev/null and b/images/installation/dashboard-supabase-connection.png differ diff --git a/images/installation/overview-sync-rules.png b/images/installation/overview-sync-rules.png deleted file mode 100644 index 736437c0..00000000 Binary files a/images/installation/overview-sync-rules.png and /dev/null differ diff --git a/images/usage/tools/dashboard-add-instance.png b/images/usage/tools/dashboard-add-instance.png new file mode 100644 index 00000000..b1c727a7 Binary files /dev/null and b/images/usage/tools/dashboard-add-instance.png differ diff --git a/images/usage/tools/dashboard-connect-button.png b/images/usage/tools/dashboard-connect-button.png new file mode 100644 index 00000000..9f490abe Binary files /dev/null and b/images/usage/tools/dashboard-connect-button.png differ diff --git a/images/usage/tools/dashboard-create-project.png b/images/usage/tools/dashboard-create-project.png new file mode 100644 index 00000000..c34b4d38 Binary files /dev/null and b/images/usage/tools/dashboard-create-project.png differ diff --git a/images/usage/tools/dashboard-org-level.png b/images/usage/tools/dashboard-org-level.png new file mode 100644 index 00000000..1df33d00 Binary files /dev/null and b/images/usage/tools/dashboard-org-level.png differ diff --git a/installation/authentication-setup.mdx b/installation/authentication-setup.mdx index becf9343..245ab2b7 100644 --- a/installation/authentication-setup.mdx +++ b/installation/authentication-setup.mdx @@ -61,4 +61,4 @@ Some authentication providers already generate JWTs for users which PowerSync ca 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. diff --git a/installation/authentication-setup/custom.mdx b/installation/authentication-setup/custom.mdx index 557a83ad..79f5ff96 100644 --- a/installation/authentication-setup/custom.mdx +++ b/installation/authentication-setup/custom.mdx @@ -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. diff --git a/installation/authentication-setup/development-tokens.mdx b/installation/authentication-setup/development-tokens.mdx index ac62df3b..6d19452b 100644 --- a/installation/authentication-setup/development-tokens.mdx +++ b/installation/authentication-setup/development-tokens.mdx @@ -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_). - - - - - -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). - - - - - - -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`) - - - - - -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 diff --git a/installation/authentication-setup/supabase-auth.mdx b/installation/authentication-setup/supabase-auth.mdx index cccf8819..cac11edc 100644 --- a/installation/authentication-setup/supabase-auth.mdx +++ b/installation/authentication-setup/supabase-auth.mdx @@ -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. - - - +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). - - - +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. + + +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. + ### Self-hosted instances: @@ -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). diff --git a/installation/authentication-setup/supabase-auth/stytch-+-supabase.mdx b/installation/authentication-setup/supabase-auth/stytch-+-supabase.mdx index 8913ee0a..49cbe196 100644 --- a/installation/authentication-setup/supabase-auth/stytch-+-supabase.mdx +++ b/installation/authentication-setup/supabase-auth/stytch-+-supabase.mdx @@ -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/): diff --git a/installation/client-side-setup/define-your-schema.mdx b/installation/client-side-setup/define-your-schema.mdx index a5d1f299..31c0260e 100644 --- a/installation/client-side-setup/define-your-schema.mdx +++ b/installation/client-side-setup/define-your-schema.mdx @@ -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. - -**Generate schema automatically (PowerSync Cloud)** + -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). - ## Example implementation diff --git a/installation/database-connection.mdx b/installation/database-connection.mdx index 2b33bde0..d29d4991 100644 --- a/installation/database-connection.mdx +++ b/installation/database-connection.mdx @@ -37,7 +37,9 @@ Select your Postgres hosting provider for steps to connect your newly-created Po ``` -1. [Locate the connection details from RDS](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ConnectToPostgreSQLInstance.html): +1. In the [PowerSync Dashboard](https://dashboard.powersync.com/), select your project and instance and go to the **Database Connections** view. +2. Click **Connect to Source Database** and ensure the **"Postgres"** tab is selected. +3. [Locate the connection details from RDS](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ConnectToPostgreSQLInstance.html): * Copy the **"Endpoint"** value. * Paste the endpoint into the "**Host**" field. * Complete the remaining fields: "**Name**", "**Host**", "**Port**", "**Database name**", "**Username**", "**Password**" and "**SSL Mode"** are required. You can paste a connection string into the "**URI**" field to simplify this. @@ -45,9 +47,8 @@ Select your Postgres hosting provider for steps to connect your newly-created Po * "**Port**" is 5432 for Postgres databases. * "**Username**" and "**Password**" maps to the `powersync_role` created in [Source Database Setup](/installation/database-setup). * PowerSync has the AWS RDS CA certificate pre-configured — `verify-full` SSL mode can be used directly, without any additional configuration required. - * If you want to query your source database via the PowerSync Dashboard, enable "**Allow querying data from the dashboard?**". -2. Click **"Test Connection"** and fix any errors. -3. Click **"Save".** +4. Click **Test Connection** and fix any errors. +5. Click **Save Connection**. PowerSync deploys and configures an isolated cloud environment for you, which can take a few minutes to complete. @@ -56,63 +57,69 @@ PowerSync deploys and configures an isolated cloud environment for you, which ca If you get an error such as "IPs in this range are not supported", the instance is likely not configured to be publicly accessible. A DNS lookup on the host should give a public IP, and not for example `10.x.x.x` or `172.31.x.x`. -1. Fill in your connection details from Azure. +1. In the [PowerSync Dashboard](https://dashboard.powersync.com/), select your project and instance and go to the **Database Connections** view. +2. Click **Connect to Source Database** and ensure the **"Postgres"** tab is selected. +3. Fill in your connection details from Azure. 1. "**Name**", "**Host**", "**Port**", "**Database name**", "**Username**", "**Password**" and "**SSL Mode"** are required. You can also paste a connection string into the "**URI**" field to simplify data entry. 2. "**Name**" can be any name for the connection. 3. "**Port**" is 5432 for Postgres databases. 4. "**Username**" and "**Password**" maps to the `powersync_role` created in [Source Database Setup](/installation/database-setup). 5. PowerSync has the Azure CA certificate pre-configured — `verify-full` SSL mode can be used directly, without any additional configuration required. - 6. If you want to query your source database via the PowerSync Dashboard, enable "**Allow querying data from the dashboard?**". -2. Click **"Test Connection"** and fix any errors. +4. Click **Test Connection** and fix any errors. * If you encounter the error `"must be superuser or replication role to start walsender"`, ensure that you've followed all the steps for enabling logical replication documented [here](https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/concepts-logical#prerequisites-for-logical-replication-and-logical-decoding). -3. Click **"Save".** +5. Click **Save Connection**. PowerSync deploys and configures an isolated cloud environment for you, which can take a few minutes to complete. -1. Fill in your connection details from Google Cloud SQL. +1. In the [PowerSync Dashboard](https://dashboard.powersync.com/), select your project and instance and go to the **Database Connections** view. +2. Click **Connect to Source Database** and ensure the **"Postgres"** tab is selected. +3. Fill in your connection details from Google Cloud SQL. * "**Name**", "**Host**", "**Port**", "**Database name**", "**Username**", "**Password**" and "**SSL Mode"** are required. You can paste a connection string into the "**URI**" field to simplify data entry. * "**Name**" can be any name for the connection. * "**Port**" is 5432 for Postgres databases. * "**Username**" and "**Password**" maps to the `powersync_role` created in [Source Database Setup](/installation/database-setup). * The server certificate can be downloaded from Google Cloud SQL. * If SSL is enforced, a client certificate and key must also be created on Google Cloud SQL, and configured on the PowerSync instance. - * If you want to query your source database via the PowerSync Dashboard, enable "**Allow querying data from the dashboard?**". -2. Click **"Test Connection"** and fix any errors. -3. Click **"Save".** +4. Click **Test Connection** and fix any errors. +5. Click **Save Connection**. PowerSync deploys and configures an isolated cloud environment for you, which can take a few minutes to complete. -1. Fill in your connection details from [Neon](https://neon.tech/). +1. In the [PowerSync Dashboard](https://dashboard.powersync.com/), select your project and instance and go to the **Database Connections** view. +2. Click **Connect to Source Database** and ensure the **"Postgres"** tab is selected. +3. Fill in your connection details from [Neon](https://neon.tech/). 1. "**Name**", "**Host**", "**Port**", "**Database name**", "**Username**", "**Password**" and "**SSL Mode"** are required. You can paste a connection string into the "**URI**" field to simplify data entry. 2. "**Name**" can be any name for the connection. 3. "**Port**" is 5432 for Postgres databases. 4. "**Username**" and "**Password**" maps to the `powersync_role` created in [Source Database Setup](/installation/database-setup). 5. Note that if you're using a self-signed SSL certificate for your database server, click the "Download Certificate" button to dynamically fetch the recommended certificate directly from your server. 6. Also note if you get any error such as `server certificate not trusted: SELF_SIGNED_CERT_IN_CHAIN`, click "Download Certificate" to attempt automatic resolution. - 7. If you want to query your source database via the PowerSync Dashboard, enable "**Allow querying data from the dashboard?**". -2. Click **"Test Connection"** and fix any errors. -3. Click **"Save".** +4. Click **Test Connection** and fix any errors. +5. Click **Save Connection**. PowerSync deploys and configures an isolated cloud environment for you, which can take a few minutes to complete. -1. Fill in your connection details from [Fly Postgres](https://fly.io/docs/postgres/). +1. In the [PowerSync Dashboard](https://dashboard.powersync.com/), select your project and instance and go to the **Database Connections** view. +2. Click **Connect to Source Database** and ensure the **"Postgres"** tab is selected. +3. Fill in your connection details from [Fly Postgres](https://fly.io/docs/postgres/). 1. "**Name**", "**Host**", "**Port**", "**Database name**", "**Username**", "**Password**" and "**SSL Mode"** are required. You can paste a connection string into the "**URI**" field to simplify data entry. 2. "**Name**" can be any name for the connection. 3. "**Port**" is 5432 for Postgres databases. 4. "**Username**" and "**Password**" maps to the `powersync_role` created in [Source Database Setup](/installation/database-setup). 5. Note that if you're using a self-signed SSL certificate for your database server, click the "Download Certificate" button to dynamically fetch the recommended certificate directly from your server. 6. Also note if you get any error such as `server certificate not trusted: SELF_SIGNED_CERT_IN_CHAIN`, click "Download Certificate" to attempt automatic resolution. - 7. If you want to query your source database via the PowerSync Dashboard, enable "**Allow querying data from the dashboard?**". -2. Click **"Test Connection"** and fix any errors. -3. Click **"Save".** +4. Click **Test Connection** and fix any errors. +5. Click **Save Connection**. PowerSync deploys and configures an isolated cloud environment for you, which can take a few minutes to complete. -1. Head to your PlanetScale database dashboard page at `https://app.planetscale.com//` and click on the "Connect" button to get your database connection parameters. +1. In the [PowerSync Dashboard](https://dashboard.powersync.com/), select your project and instance and go to the **Database Connections** view. +2. Click **Connect to Source Database** and ensure the **"Postgres"** tab is selected. +3. Head to your PlanetScale database dashboard page at `https://app.planetscale.com//` and click on the "Connect" button to get your database connection parameters. 1. In the PowerSync dashboard, "**Name**", "**Host**", "**Port**", "**Database name**", "**Username**" and "**Password**" are required. 2. "**Name**" can be any name for the connection. 3. "**Host**" is the `host` connection parameter for your database. @@ -120,9 +127,8 @@ PowerSync deploys and configures an isolated cloud environment for you, which ca 5. "**Username**" and "**Password**" maps to the `powersync_role` created in [Source Database Setup](/installation/database-setup). 1. Important: PlanetScale requires your branch ID to be appended to your username. The username should be `powersync_role`.\. Your PlanetScale branch ID can be found on the same connection details page. 6. **SSL Mode** can remain the default `verify-full`. - 7. If you want to query your source database via the PowerSync Dashboard, enable "**Allow querying data from the dashboard?**". -2. Click **"Test Connection"** and fix any errors. -3. Click **"Save".** +4. Click **Test Connection** and fix any errors. +5. Click **Save Connection**. PowerSync deploys and configures an isolated cloud environment for you, which can take a few minutes to complete. @@ -130,16 +136,17 @@ PowerSync deploys and configures an isolated cloud environment for you, which ca For other providers and self-hosted databases: - 1. Fill in your connection details. + 1. In the [PowerSync Dashboard](https://dashboard.powersync.com/), select your project and instance and go to the **Database Connections** view. + 2. Click **Connect to Source Database** and ensure the **"Postgres"** tab is selected. + 3. Fill in your connection details. 1. "**Name**", "**Host**", "**Port**", "**Database name**", "**Username**", "**Password**" and "**SSL Mode"** are required. You can paste a connection string into the "**URI**" field to simplify data entry. 2. "**Name**" can be any name for the connection. 3. "**Port**" is 5432 for Postgres databases. 4. "**Username**" and "**Password**" maps to the `powersync_role` created in [Source Database Setup](/installation/database-setup). 5. Note that if you're using a self-signed SSL certificate for your database server, click the "Download Certificate" button to dynamically fetch the recommended certificate directly from your server. 6. Also note if you get any error such as `server certificate not trusted: SELF_SIGNED_CERT_IN_CHAIN`, click "Download Certificate" to attempt automatic resolution. - 7. If you want to query your source database via the PowerSync Dashboard, enable "**Allow querying data from the dashboard?**". -1. Click **"Test Connection"** and fix any errors. -2. Click **"Save".** +4. Click **Test Connection** and fix any errors. +5. Click **Save Connection**. PowerSync deploys and configures an isolated cloud environment for you, which can take a few minutes to complete. @@ -147,14 +154,16 @@ PowerSync deploys and configures an isolated cloud environment for you, which ca ## MongoDB Specifics -1. Fill in your connection details from MongoDB: +1. In the [PowerSync Dashboard](https://dashboard.powersync.com/), select your project and instance and go to the **Database Connections** view. +2. Click **Connect to Source Database** and ensure the **"MongoDB"** tab is selected. +3. Fill in your connection details from MongoDB: 1. Copy your cluster's connection string and paste it into the PowerSync instance **URI** field. PowerSync will automatically parse this URI to populate other connection details. - The format should be `mongodb+srv://[username:password@]host/[database]`. For example, `mongodb+srv://admin:@cluster0.abcde1.mongodb.net/powersync` 2. Enter your database user's password into the **Password** field. See the necessary permissions in [Source Database Setup](/installation/database-setup#mongodb). 3. "**Database name**" is the database in your cluster to replicate. -2. Click **"Test Connection"** and fix any errors. If have any issues connecting, reach out to our support engineers on our [Discord server](https://discord.gg/powersync) or otherwise [contact us](/resources/contact-us). +4. Click **Test Connection** and fix any errors. If have any issues connecting, reach out to our support engineers on our [Discord server](https://discord.gg/powersync) or otherwise [contact us](/resources/contact-us). 1. Make sure that your database allows access to PowerSync's IPs — see [Security and IP Filtering](/installation/database-setup/security-and-ip-filtering) -3. Click **"Save"**. +5. Click **Save Connection**. PowerSync deploys and configures an isolated cloud environment for you, which can take a few minutes to complete. @@ -165,7 +174,6 @@ Also see: ## MySQL (Beta) Specifics Select your MySQL hosting provider for steps to connect your newly-created PowerSync instance to your MySQL database: - To enable binary logging and GTID replication in AWS Aurora, you need to create a [DB Parameter Group](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraMySQL.Reference.ParameterGroups.html) and configure it with the necessary parameters. Follow these steps: @@ -186,24 +194,35 @@ and configure it with the necessary parameters. Follow these steps: 4. In the DB Parameter Group section, select the parameter group you created. 5. Click Continue and then Apply immediately. 4. Whitelist PowerSync's IPs in your Aurora cluster's security group to allow access. See [Security and IP Filtering](/installation/database-setup/security-and-ip-filtering) for more details. -5. +5. In the [PowerSync Dashboard](https://dashboard.powersync.com/), select your project and instance and go to the **Database Connections** view. +6. Click **Connect to Source Database** and ensure the **"MySQL"** tab is selected. +7. Fill in your MySQL connection details from AWS Aurora: + 1. "**Name**", "**Host**", "**Port**", "**Database name**", "**Username**", "**Password**" are required. + 2. "**Name**" can be any name for the connection. + 3. "**Host**" is the endpoint for your Aurora cluster. + 4. "**Database name**" is the default database to replicate. + 5. "**Username**" and "**Password**" maps to your database user. +8. Click **Test Connection** and fix any errors. +9. Click **Save Connection**. + +PowerSync deploys and configures an isolated cloud environment for you, which can take a few minutes to complete. For other providers and self-hosted databases: -Fill in your MySQL connection details: +1. In the [PowerSync Dashboard](https://dashboard.powersync.com/), select your project and instance and go to the **Database Connections** view. +2. Click **Connect to Source Database** and ensure the **"MySQL"** tab is selected. +3. Fill in your MySQL connection details: 1. "**Name**", "**Host**", "**Port**", "**Database name**", "**Username**", "**Password**" are required. 2. "**Name**" can be any name for the connection. 3. "**Host**" the endpoint for your database. - 4. "**Database name**" is the default database to replicate. Additional databases are derived by qualifying the tables in the sync rules. + 4. "**Database name**" is the default database to replicate. Additional databases are derived by qualifying the tables in the Sync Rules. 5. "**Username**" and "**Password**" maps to your database user. - 6. If you want to query your source database via the PowerSync Dashboard, enable "**Allow querying data from the dashboard?**". - 7. Click **"Test Connection"** and fix any errors. - 8. Click **"Save".** +4. Click **Test Connection** and fix any errors. +5. Click **Save Connection**. PowerSync deploys and configures an isolated cloud environment for you, which can take a few minutes to complete. - Make sure that your MySQL database allows access to PowerSync's IPs — see [Security and IP Filtering](/installation/database-setup/security-and-ip-filtering) diff --git a/installation/database-setup.mdx b/installation/database-setup.mdx index 1202fd91..2eb136f0 100644 --- a/installation/database-setup.mdx +++ b/installation/database-setup.mdx @@ -313,7 +313,7 @@ Post-images can be configured for PowerSync instances as follows: - Configure the **Post Images** setting in the connection configuration in the Dashboard (right-click on your instance to edit it). + Configure the **Post Images** setting in the connection configuration in the [PowerSync Dashboard](https://dashboard.powersync.com/). Select your project and instance and go to the **Database Connections** view to edit the connection settings. Configure `post_images` in the `config.yaml` file. @@ -371,7 +371,7 @@ GRANT SELECT ON .* TO 'repl_user'@'%'; FLUSH PRIVILEGES; ``` -It is possible to constrain the MySQL user further and limit access to specific tables. Care should be taken to ensure that all the tables in the sync rules are included in the grants. +It is possible to constrain the MySQL user further and limit access to specific tables. Care should be taken to ensure that all the tables in the Sync Rules are included in the grants. ```sql -- Grant select to the users and the invoices tables in the source database GRANT SELECT ON .users TO 'repl_user'@'%'; diff --git a/installation/database-setup/private-endpoints.mdx b/installation/database-setup/private-endpoints.mdx index f4b6ce16..784d2934 100644 --- a/installation/database-setup/private-endpoints.mdx +++ b/installation/database-setup/private-endpoints.mdx @@ -17,7 +17,7 @@ Do not rely on Private Endpoints as the only form of security. Always use strong 1. Private Endpoints are currently only supported for Postgres and MongoDB instances. [Contact us](/resources/contact-us) if you need this for MySQL. 2. Self-service is not yet available on the PowerSync side — [contact PowerSync support](/resources/contact-us) to configure the instance. 3. Only AWS is supported currently — other cloud providers are not supported yet. -4. The **"Test Connection"** function on the [PowerSync Dashboard](/usage/tools/powersync-dashboard) is not supported yet - the instance has to be deployed to test the connection. +4. The **"Test Connection"** function on the [PowerSync Dashboard](https://dashboard.powersync.com/) is not supported yet - the instance has to be deployed to test the connection. ## Concepts diff --git a/integration-guides/flutterflow-+-powersync.mdx b/integration-guides/flutterflow-+-powersync.mdx index 5eb700a1..2efb6a14 100644 --- a/integration-guides/flutterflow-+-powersync.mdx +++ b/integration-guides/flutterflow-+-powersync.mdx @@ -86,12 +86,9 @@ This guide walks you through building a basic item management app from scratch a [Sync Rules](/usage/sync-rules) allow developers to control which data gets synced to which user devices using a SQL-like syntax in a YAML file. For the demo app, we're going to specify that each user can only see their own lists. -1. To update your Sync Rules, open the `sync-rules.yaml` file. - - - +1. In the [PowerSync Dashboard](https://dashboard.powersync.com/), select your project and instance and go to the **Sync Rules** view. -2. Replace the `sync-rules.yaml` file's contents with the below: +2. Edit the Sync Rules in the editor and replace the contents with the below: ```yaml # This will sync the entire table to all users - we will refine this later bucket_definitions: @@ -99,8 +96,8 @@ This guide walks you through building a basic item management app from scratch a data: - SELECT * FROM lists ``` -3. In the top right, click **"Validate sync rules"** and ensure there are no errors. This validates your sync rules against your Postgres database. -4. In the top right, click **"Deploy sync rules"** and select your instance. +3. Click **"Validate"** and ensure there are no errors. This validates your Sync Rules against your Postgres database. +4. Click **"Deploy"** to deploy your Sync Rules. 5. Confirm in the dialog and wait a couple of minutes for the deployment to complete. @@ -118,7 +115,7 @@ This guide walks you through building a basic item management app from scratch a 4. Under **"App Settings" -> "Project Dependencies" -> "FlutterFlow Libraries"** click "Add Library". 1. Select the "PowerSync" library. 2. Add your schema: - 1. On the PowerSync Dashboard, right-click on your instance and select "Generate Client-Side Schema" and select "FlutterFlow" as the language. + 1. In the [PowerSync Dashboard](https://dashboard.powersync.com/), select your project and instance and click the **Connect** button in the top bar to generate the client-side schema based on your Sync Rules. Select "FlutterFlow" as the language. @@ -586,8 +583,8 @@ create policy "owned lists" on public.lists for ALL using ( Currently all lists are synced to all users, regardless of who the owner of the list is. You will now update this so that only a user's lists are synced to their device: -1. Navigate to the [PowerSync Dashboard](https://powersync.journeyapps.com/) and open your `sync-rules.yaml` file. -2. Delete the existing content and paste the below contents: +1. In the [PowerSync Dashboard](https://dashboard.powersync.com/), select your project and instance and go to the **Sync Rules** view. +2. Edit the Sync Rules in the editor and replace the contents with the below: ```yaml bucket_definitions: @@ -597,8 +594,8 @@ bucket_definitions: - select * from lists where owner_id = bucket.user_id ``` -3. Click on **"Validate"**. -4. Click on **"Deploy sync rules"**. +3. Click **"Validate"**. +4. Click **"Deploy"** to deploy your Sync Rules. 5. Wait for the deploy to complete. diff --git a/integration-guides/flutterflow-+-powersync/handling-attachments.mdx b/integration-guides/flutterflow-+-powersync/handling-attachments.mdx index 9492fa6f..fab721e7 100644 --- a/integration-guides/flutterflow-+-powersync/handling-attachments.mdx +++ b/integration-guides/flutterflow-+-powersync/handling-attachments.mdx @@ -37,7 +37,7 @@ Here we add a `photo_id` column to the `lists` table to link a photo to a list. ### Update PowerSync schema The schema of the local SQLite database should now be updated to include the new `photo_id` column. Additionally, we need to set up a local-only table to store the metadata of photos which is being managed by the helper package. -1. In the PowerSync Dashboard, generate your updated client-side schema: Right-click on your instance and select "Generate Client-Side Schema" and select "FlutterFlow" as the language. +1. In the [PowerSync Dashboard](https://dashboard.powersync.com/), select your project and instance and click the **Connect** button in the top bar to generate the client-side schema based on your Sync Rules. Select "FlutterFlow" as the language. diff --git a/integration-guides/flutterflow-+-powersync/powersync-+-flutterflow-legacy.mdx b/integration-guides/flutterflow-+-powersync/powersync-+-flutterflow-legacy.mdx index 6aef9a63..1fb49057 100644 --- a/integration-guides/flutterflow-+-powersync/powersync-+-flutterflow-legacy.mdx +++ b/integration-guides/flutterflow-+-powersync/powersync-+-flutterflow-legacy.mdx @@ -85,12 +85,9 @@ create publication powersync for table public.lists; [Sync Rules](/usage/sync-rules) allow developers to control which data gets synced to which user devices using a SQL-like syntax in a YAML file. For the demo app, we're going to specify that each user can only see their own to-do lists and list items. -1\. To update your Sync Rules, open the `sync-rules.yaml` file. +1. In the [PowerSync Dashboard](https://dashboard.powersync.com/), select your project and instance and go to the **Sync Rules** view. - - - -1. Replace the `sync-rules.yaml` file's contents with the below: +2. Edit the Sync Rules in the editor and replace the contents with the below: ```yaml This will sync the entire table to all users - we will refine this later bucket_definitions: @@ -163,7 +160,7 @@ For once, a blank screen means success: 1. **NOTE:** use all lowercase for this Custom Action is important due to naming conversion that FF performs behind the scenes. 3. Copy and paste the custom action code from here:[https://github.com/powersync-ja/powersync-flutterflow-template/blob/flutterflow/lib/custom\_code/actions/initpowersync.dart](https://github.com/powersync-ja/powersync-flutterflow-template/blob/flutterflow/lib/custom_code/actions/initpowersync.dart) 4. Import your schema: - 1. On the PowerSync Dashboard, right-click on your instance and select **"Generate Client-Side Schema"** and select Dart as the language. + 1. On the PowerSync Dashboard, click the **Connect** button in the top bar to generate the client-side schema based on your Sync Rules. Select Dart as the language. @@ -626,8 +623,8 @@ create policy "owned lists" on public.lists for ALL using ( Currently all lists are synced to all users, regardless of who the owner of the list is. You will now update this so that only a user's lists are synced to their device: -1. Navigate to the [PowerSync Dashboard](/usage/tools/powersync-dashboard) and open your `sync-rules.yaml` file. -2. Delete the existing content and paste the below contents: +1. In the [PowerSync Dashboard](https://dashboard.powersync.com/), select your project and instance and go to the **Sync Rules** view. +2. Edit the Sync Rules in the editor and replace the contents with the below: ```yaml bucket_definitions: @@ -637,8 +634,8 @@ bucket_definitions: - select * from lists where owner_id = bucket.user_id ``` -1. Click on **"Validate".** -2. Click on **"Deploy sync rules".** +1. Click **"Validate"**. +2. Click **"Deploy"** to deploy your Sync Rules. 3. Wait for the deploy to complete. diff --git a/integration-guides/railway-+-powersync.mdx b/integration-guides/railway-+-powersync.mdx index 5829d1de..8e1655dc 100644 --- a/integration-guides/railway-+-powersync.mdx +++ b/integration-guides/railway-+-powersync.mdx @@ -17,7 +17,7 @@ Find the PowerSync template on the Railway Marketplace, or click the button belo /> - This template automatically creates `lists` and `todos` tables in your Postgres database. The default sync rules are configured to sync these tables to your clients. + This template automatically creates `lists` and `todos` tables in your Postgres database. The default Sync Rules are configured to sync these tables to your clients. The `Execute Scripts` service creates the **powersync** publication for these tables. We recommend limiting the publication to only the tables you want clients to download. @@ -53,7 +53,7 @@ Find the PowerSync template on the Railway Marketplace, or click the button belo **After adding tables with either option:** - 1. Update the sync rules in your YAML config (Step 2) to include the new tables + 1. Update the Sync Rules in your YAML config (Step 2) to include the new tables 2. Re-encode the YAML to base64 and update the `POWERSYNC_CONFIG_B64` environment variable @@ -67,7 +67,7 @@ Let's fix this by generating the config, setting the variable, and restarting th - Start with the configuration below and update the sync rules to match your schema: + Start with the configuration below and update the Sync Rules to match your schema: ```yaml replication: @@ -130,7 +130,7 @@ Let's fix this by generating the config, setting the variable, and restarting th 1. [Generate a development token](https://docs.powersync.com/tutorials/self-host/generate-dev-token) 2. Open the PowerSync Diagnostics App service -3. Paste your token to test your connection and sync rules +3. Paste your token to test your connection and Sync Rules ### Step 4: Connect Your Client diff --git a/integration-guides/supabase-+-powersync.mdx b/integration-guides/supabase-+-powersync.mdx index 279ec3de..bb37c774 100644 --- a/integration-guides/supabase-+-powersync.mdx +++ b/integration-guides/supabase-+-powersync.mdx @@ -37,7 +37,7 @@ Upon successful integration of Supabase + PowerSync, your system architecture wi -The local SQLite database embedded in the PowerSync SDK is automatically kept in sync with the Supabase Postgres database (based on configured sync rules as you will see later in this guide). Client-side data modifications are persisted in the local SQLite database as well as stored in an upload queue that gets processed via the Supabase client library when network connectivity is available. Therefore reads and writes can happen in the app regardless of whether the user is online or offline, by using the local SQLite database. +The local SQLite database embedded in the PowerSync SDK is automatically kept in sync with the Supabase Postgres database (based on configured Sync Rules as you will see later in this guide). Client-side data modifications are persisted in the local SQLite database as well as stored in an upload queue that gets processed via the Supabase client library when network connectivity is available. Therefore reads and writes can happen in the app regardless of whether the user is online or offline, by using the local SQLite database. For more details on PowerSync's general architecture, [see here](/architecture/architecture-overview). @@ -126,7 +126,9 @@ Run the below SQL statement in your **Supabase SQL Editor** to create a Postgres [Sync Rules](/usage/sync-rules) allow developers to control which data gets synced to which user devices using a SQL-like syntax in a YAML file. For the demo app, we're going to specify that each user can only see their own to-do lists and list items. -1. The final step is to replace the Sync Rules file's contents with the below: +1. In the [PowerSync Dashboard](https://dashboard.powersync.com/), select your project and instance and go to the **Sync Rules** view. + +2. Edit the Sync Rules in the editor and replace the contents with the below: ```yaml bucket_definitions: @@ -138,16 +140,10 @@ bucket_definitions: - select * from todos where list_id = bucket.list_id ``` - - - - -2. Click **"Validate sync rules"** and ensure there are no errors. This validates your sync rules against your Postgres database. -3. Click **"Save and deploy"** to deploy your Sync Rules. +2. Click **"Validate"** and ensure there are no errors. This validates your Sync Rules against your Postgres database. +3. Click **"Deploy"** to deploy your Sync Rules. -- Your Sync Rules can be updated by navigating to the **Manage instances** workspace and selecting the `sync-rules.yaml` file. - - For additional information on PowerSync's Sync Rules, refer to the [Sync Rules](/usage/sync-rules) documentation. - If you're wondering how Sync Rules relate to Supabase Postgres [RLS](https://supabase.com/docs/guides/auth/row-level-security), see [this subsection](/integration-guides/supabase-+-powersync/rls-and-sync-rules). @@ -235,11 +231,8 @@ SUPABASE_ANON_KEY=foo # from https://supabase.com/dashboard/project/_/settings/a 1. In the relevant config file, replace the values for `supabaseUrl` (from the [Project URL](https://supabase.com/dashboard/project/_/settings/api) section in the Supabase dashboard) and `supabaseAnonKey` (from the [API Keys](https://supabase.com/dashboard/project/_/settings/api-keys) section in the Supabase dashboard) -2. For the value of `powersyncUrl`, click the copy icon on your instance to copy its URL: +2. For the value of `powersyncUrl`, click **Connect** in the top bar of the [PowerSync Dashboard](https://dashboard.powersync.com/) and copy the instance URL from the dialog. - - - #### Run the app diff --git a/intro/powersync-overview.mdx b/intro/powersync-overview.mdx index 3127bb0e..c035acca 100644 --- a/intro/powersync-overview.mdx +++ b/intro/powersync-overview.mdx @@ -60,7 +60,7 @@ Learn how to fully implement PowerSync in your project. - Sync rules control which data gets synchronized to users' devices - learn everything you need to know about sync rules. + Sync Rules control which data gets synced to users' devices - learn everything you need to know about Sync Rules. diff --git a/migration-guides/mongodb-atlas.mdx b/migration-guides/mongodb-atlas.mdx index 21a0dc26..ba21420d 100644 --- a/migration-guides/mongodb-atlas.mdx +++ b/migration-guides/mongodb-atlas.mdx @@ -81,7 +81,7 @@ Sync Rules allow you to control which data gets synced to which users/devices. E To get a good understanding of how Sync Rules operate, have a look at our blog post: [Sync Rules from First Principles: Partial Replication to SQLite](https://www.powersync.com/blog/sync-rules-from-first-principles-partial-replication-to-sqlite). -If you have a PowerSync Service instance set up and connected, open the `sync-rules.yaml` file associated with your PowerSync project and edit the SQL-like queries based on your database schema. Below is a simple Sync Rules example using a simple database schema. Sync Rules involve organizing data into ["buckets"](/usage/sync-rules/organize-data-into-buckets) (a bucket is a grouping of data). The example below uses a ["global bucket"](/usage/sync-rules/example-global-data) as a simple starting point — data in a "global bucket" will be synced to all users. +If you have a PowerSync Service instance set up and connected, select your project and instance in the [PowerSync Dashboard](https://dashboard.powersync.com/) and go to the **Sync Rules** view to edit the SQL-like queries based on your database schema. Below is a simple Sync Rules example using a simple database schema. Sync Rules involve organizing data into ["buckets"](/usage/sync-rules/organize-data-into-buckets) (a bucket is a grouping of data). The example below uses a ["global bucket"](/usage/sync-rules/example-global-data) as a simple starting point — data in a "global bucket" will be synced to all users. Note that MongoDB uses "_id" as the name of the ID field in collections whereas PowerSync uses "id" in its client-side database. This is why `SELECT _id as id` should always be used in the data queries when pairing PowerSync with MongoDB. @@ -109,7 +109,7 @@ Add PowerSync to your app project by following the instructions for the relevant The PowerSync client-side schema represents a "view" of the data synced from the PowerSync Service to the client app. No migrations are required — the schema is applied directly when the local PowerSync SQLite database is constructed. -To make this step easy for you, the [PowerSync Dashboard](/usage/tools/powersync-dashboard) allows automatically generating the client-side schema based on the Sync Rules defined for a PowerSync instance. To generate the schema, go to the [dashboard](https://powersync.journeyapps.com/), right-click on the instance, and select "Generate Client Schema". Alternatively you can use the PowerSync [CLI](/usage/tools/cli) to generate the schema. +To make this step easy for you, the [PowerSync Dashboard](https://dashboard.powersync.com/) allows automatically generating the client-side schema based on the Sync Rules defined for a PowerSync instance. To generate the schema, click the **Connect** button in the top bar to generate the client-side schema based on your Sync Rules in your preferred language. Alternatively you can use the PowerSync [CLI](/usage/tools/cli) to generate the schema. Here is an example of a client-side schema for PowerSync using a simple `todos` table: diff --git a/resources/usage-and-billing.mdx b/resources/usage-and-billing.mdx index 55a65127..14219d31 100644 --- a/resources/usage-and-billing.mdx +++ b/resources/usage-and-billing.mdx @@ -34,17 +34,13 @@ On our paid plans, the base fee (plus applicable tax) is charged at the start of If your month's usage exceeds your plan's limits, the overage will be charged at the end of the billing cycle. -Your current billing cycle's usage and upcoming invoice total can be tracked in the Admin Portal - learn more in [View and manage your subscription](/resources/usage-and-billing#view-and-manage-your-subscription). +Your current billing cycle's usage and upcoming invoice total can be tracked in the Dashboard - learn more in [View and manage your subscription](/resources/usage-and-billing#view-and-manage-your-subscription). Invoices will be automatically charged to your provided payment card. Learn more in [Spending caps](/resources/usage-and-billing#spending-caps). ## View and manage your subscription -Your PowerSync usage and billing can be tracked and managed in the [Admin Portal](https://accounts.journeyapps.com/portal/admin/). - - - We are gradually rolling out this functionality to users. If you are not seeing your subscription details at this time, please [reach out to us](/resources/contact-us) and we'll enable it for you. - +Your PowerSync usage and billing can be tracked and managed in the [PowerSync Dashboard](https://dashboard.powersync.com/) at the organization level. ### Subscriptions @@ -77,6 +73,6 @@ Usage limits for PowerSync Cloud are specified on our [Pricing page](https://www Instances on the Free plan that have had no deploys or client connections for over 7 days will be deprovisioned. This helps us optimize our cloud resources and ensure a better experience for all users. -If your instance is deprovisioned, you can easily restart it from the [Dashboard](/usage/tools/powersync-dashboard) or [CLI](/usage/tools/cli) by deploying Sync Rules to it. Note that this will reprocess your Sync Rules from scratch, causing data to re-sync to existing users. +If your instance is deprovisioned, you can easily restart it from the [PowerSync Dashboard](https://dashboard.powersync.com/) or [CLI](/usage/tools/cli) by deploying Sync Rules to it. Note that this will reprocess your Sync Rules from scratch, causing data to re-sync to existing users. -For projects in production we recommend subscribing to a [paid plan](https://www.powersync.com/pricing) to avoid any interruptions. To upgrade to a paid plan, visit the Subscriptions tab in your [Admin Portal](https://accounts.journeyapps.com/portal/admin/). +For projects in production we recommend subscribing to a [paid plan](https://www.powersync.com/pricing) to avoid any interruptions. To upgrade to a paid plan, navigate to your organization in the [PowerSync Dashboard](https://dashboard.powersync.com/) and visit the **Plans & Billing** section. diff --git a/resources/usage-and-billing/usage-and-billing-faq.mdx b/resources/usage-and-billing/usage-and-billing-faq.mdx index ac14d73a..e50403a5 100644 --- a/resources/usage-and-billing/usage-and-billing-faq.mdx +++ b/resources/usage-and-billing/usage-and-billing-faq.mdx @@ -16,7 +16,7 @@ description: "Usage and billing FAQs and troubleshooting strategies." You can track usage in two ways: - Individual instances: Visit the [Usage metrics](/usage/tools/monitoring-and-alerting#usage-metrics) workspace in the PowerSync Dashboard. - - Organization-wide usage: Check the **Subscriptions** tab in the [Admin Portal](https://accounts.journeyapps.com/portal/admin/) for aggregated metrics across all instances in your current billing cycle. + - Organization-wide usage: Navigate to your organization in the [PowerSync Dashboard](https://dashboard.powersync.com/) and check the **Plans & Billing** section for aggregated metrics across all instances in your current billing cycle. A sync operation occurs when a single row is synced from the PowerSync Service to a user device. @@ -60,7 +60,7 @@ description: "Usage and billing FAQs and troubleshooting strategies." The PowerSync Service hosts: - 1. A current copy of the data, which should be roughly equal to the subset of your source data that is covered by your sync rules configuration; + 1. A current copy of the data, which should be roughly equal to the subset of your source data that is covered by your Sync Rules configuration; 2. A history of all operations on data in buckets. This can be bigger than the source, since it includes the history, and one row can be in multiple buckets; and 3. Data for parameter lookups. This should be fairly small in most cases. @@ -89,13 +89,13 @@ description: "Usage and billing FAQs and troubleshooting strategies." - Head over to the **Subscriptions** tab of the [Admin Portal](https://accounts.journeyapps.com/portal/admin/). Here you can view your total usage (aggregated across all projects in your organization) and upcoming invoice total for your current billing cycle. Data in this view updates once a day. + Navigate to your organization in the [PowerSync Dashboard](https://dashboard.powersync.com/) and go to the **Plans & Billing** section. Here you can view your total usage (aggregated across all projects in your organization) and upcoming invoice total for your current billing cycle. Data in this view updates once a day. - You can update your billing details in the **Billing** tab of the [Admin Portal](https://accounts.journeyapps.com/portal/admin/). + You can update your billing details in the **Plans & Billing** section of the [PowerSync Dashboard](https://dashboard.powersync.com/) at the organization level. - You can review your historic invoices directly in the Stripe Customer Portal, by signing in with your billing email [here](https://billing.stripe.com/p/login/7sI6pU48L42cguc7ss). We may surface these in the Admin Portal in the future. + You can review your historic invoices directly in the Stripe Customer Portal, by signing in with your billing email [here](https://billing.stripe.com/p/login/7sI6pU48L42cguc7ss). We may surface these in the Dashboard in the future. Under the updated pricing for Pro and Team plans: diff --git a/self-hosting/getting-started.mdx b/self-hosting/getting-started.mdx index fad83bd2..c123cfc0 100644 --- a/self-hosting/getting-started.mdx +++ b/self-hosting/getting-started.mdx @@ -16,7 +16,7 @@ description: "Self-host PowerSync in your own infrastructure (PowerSync Open Edi The [PowerSync Service](https://github.com/powersync-ja/powersync-service) can be self-hosted using Docker. It is published to Docker Hub as [journeyapps/powersync-service](https://hub.docker.com/r/journeyapps/powersync-service) -Note that the [PowerSync Dashboard](/usage/tools/powersync-dashboard) is currently not available in the PowerSync Open Edition. +Note that the [PowerSync Dashboard](https://dashboard.powersync.com/) is currently not available in the PowerSync Open Edition. We have five starting points, detailed below: diff --git a/snippets/create-cloud-instance.mdx b/snippets/create-cloud-instance.mdx index ff92d1c4..ec410512 100644 --- a/snippets/create-cloud-instance.mdx +++ b/snippets/create-cloud-instance.mdx @@ -1,14 +1,12 @@ -1. In the **Overview** workspace of the [PowerSync Dashboard](/usage/tools/powersync-dashboard), you will be prompted to create your first instance: +When creating a project in the [PowerSync Dashboard](https://dashboard.powersync.com/), a Development and Production instance will be created by default. Select the instance you want to configure. + +If you need to create a new instance, follow the steps below. + +1. In the dashboard, select your project and open the instance selection dropdown. Click **Add Instance**. - + - - If you've previously created an instance in your project, you can create an additional instance by navigating to **Manage instances** and clicking **Create new instance**: - - You can also create an entirely new [project](/usage/tools/powersync-dashboard#hierarchy%3A-organization%2C-project%2C-instance) with its own set of instances. Click on the PowerSync icon in the top left corner of the Dashboard or on **Admin Portal** at the top of the Dashboard, and then click on **Create Project**. - -2. Give your instance a name, such as "Testing". +2. Give your instance a name, such as "Production". 3. [Optional] You can change the default cloud region from US to EU, JP (Japan), AU (Australia) or BR (Brazil) if desired. * Note: Additional cloud regions will be considered on request, especially for customers on our Enterprise plan. Please [contact us](/resources/contact-us) if you need a different region. -4. [Optional] You can opt in to using the `Next` version of the Service, which may contain early access or experimental features. Always use the `Stable` version in production. -5. Click **Next**. \ No newline at end of file +5. Click **Create Instance**. \ No newline at end of file diff --git a/snippets/generate-schema-automatically.mdx b/snippets/generate-schema-automatically.mdx new file mode 100644 index 00000000..b022df26 --- /dev/null +++ b/snippets/generate-schema-automatically.mdx @@ -0,0 +1,10 @@ + + **Generate schema automatically** + + In the [PowerSync Dashboard](https://dashboard.powersync.com/), select your project and instance and click the **Connect** button in the top bar to generate the client-side schema in your preferred language. The schema will be generated based off your Sync Rules. + + Similar functionality exists in the [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). + + diff --git a/snippets/supabase-database-connection.mdx b/snippets/supabase-database-connection.mdx index af34acee..6d9affdb 100644 --- a/snippets/supabase-database-connection.mdx +++ b/snippets/supabase-database-connection.mdx @@ -10,26 +10,30 @@ -3. Back in the PowerSync Dashboard, paste the connection string into the **URI** field. PowerSync will automatically parse this URI to populate the database connection details. -4. Update the **Username** and **Password** fields to use the `powersync_role` and password you created when configuring your Supabase for PowerSync (see [Source Database Setup](/installation/database-setup#supabase)). -5. Note: PowerSync includes Supabase's CA certificate by default, so you can use `verify-full` SSL mode without additional configuration. -6. Your connection settings should look similar to this: - - - -7. Verify your setup by clicking **Test Connection** and resolve any errors. -8. Click **Next**. -9. PowerSync will detect the Supabase connection and prompt you to enable Supabase auth. To enable it, copy your JWT Secret from your project's settings ([JWT Keys](https://supabase.com/dashboard/project/_/settings/jwt) section in the Supabase dashboard) and paste it here: - - -PowerSync is compatible with Supabase's new [JWT signing keys](https://supabase.com/blog/jwt-signing-keys). See this [Discord thread](https://discord.com/channels/1138230179878154300/1194710422960472175/1396878076683485205) for details on how to configure auth on your connection if you are using these keys. - +3. In the [PowerSync Dashboard](https://dashboard.powersync.com/), select your project and instance and go to the **Database Connections** view. +4. Click **Connect to Source Database** and ensure the "Postgres" tab is selected. +4. Paste the connection string into the **URI** field. PowerSync will automatically parse this URI to populate the database connection details. +5. Update the **Username** and **Password** fields to use the `powersync_role` and password you created when configuring your Supabase for PowerSync (see [Source Database Setup](/installation/database-setup#supabase)). +6. Note: PowerSync includes Supabase's CA certificate by default, so you can use `verify-full` SSL mode without additional configuration. -10. Click **Enable Supabase auth** to finalize your connection settings. + + + + +7. Verify your setup by clicking **Test Connection** and resolve any errors. +8. Click **Save Connection**. PowerSync will now create an isolated cloud environment for your instance. This typically takes a minute or two. - -You can update your instance settings by navigating to the **Manage instances** workspace, opening your instance options and selecting **Edit instance**. - - +## Enable Supabase Auth + +After your database connection is configured, enable Supabase Auth: + +1. In the PowerSync Dashboard, go to the **Client Auth** view. +2. Enable the **"Use Supabase Auth"** checkbox. +3. If your Supabase project uses the legacy JWT signing keys, copy your JWT Secret from your project's settings ([JWT Keys](https://supabase.com/dashboard/project/_/settings/jwt)) and paste the secret into the **"Supabase JWT Secret (optional) Legacy"** field. If you're using Supabase's new [JWT signing keys](https://supabase.com/blog/jwt-signing-keys), you can leave this field empty. +4. Click **Save and Deploy** to apply the changes. + + +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. + diff --git a/usage/lifecycle-maintenance/compacting-buckets.mdx b/usage/lifecycle-maintenance/compacting-buckets.mdx index e3416ee6..6f0f9ce6 100644 --- a/usage/lifecycle-maintenance/compacting-buckets.mdx +++ b/usage/lifecycle-maintenance/compacting-buckets.mdx @@ -11,7 +11,7 @@ This allows clients to download incremental changes efficiently — only changed The cloud-hosted version of PowerSync will automatically compact all buckets once per day. -Support to manually trigger compacting is available in the [Dashboard](/usage/tools/powersync-dashboard): Right-click on an instance, or search for the action using the [Command Palette](/usage/tools/powersync-dashboard#the-command-palette). Support to trigger compacting from the [CLI](/usage/tools/cli) will be added soon. +Support to manually trigger compacting is available in the [PowerSync Dashboard](https://dashboard.powersync.com/): Select your project and instance, go to the **Settings** view, and click the **Compact** button in the "Compact operation history" section. Support to trigger compacting from the [CLI](/usage/tools/cli) will be added soon. [Defragmenting](/usage/lifecycle-maintenance/compacting-buckets#defragmenting) may still be required. @@ -147,8 +147,7 @@ You should consider defragmenting your buckets when: There are manual and automated approaches to defragmenting: 1. **Manual Defragmentation** - - Use the PowerSync Dashboard to manually trigger defragmentation - - Right-click on an instance and select "Compact Buckets" with the "Defragment" checkbox selected + - Use the [PowerSync Dashboard](https://dashboard.powersync.com/) to manually trigger defragmentation: Select your project and instance, go to the **Settings** view, and click the **Defragment** button in the "Compact operation history" section - Best for one-time cleanup or after major data changes 2. **Scheduled Defragmentation** diff --git a/usage/sync-rules/advanced-topics/client-parameters.mdx b/usage/sync-rules/advanced-topics/client-parameters.mdx index a012ba97..3e32b706 100644 --- a/usage/sync-rules/advanced-topics/client-parameters.mdx +++ b/usage/sync-rules/advanced-topics/client-parameters.mdx @@ -99,9 +99,9 @@ bucket_definitions: ### Warning on potentially dangerous queries -Based on the above security consideration, the [PowerSync Dashboard](/usage/tools/powersync-dashboard) will warn developers when client parameters are being used in sync rules in an insecure way (i.e. where the query does not also include a parameter from `request.jwt()`). +Based on the above security consideration, the [PowerSync Dashboard](https://dashboard.powersync.com/) will warn developers when client parameters are being used in Sync Rules in an insecure way (i.e. where the query does not also include a parameter from `request.jwt()`). -The below sync rules will display the warning: +The below Sync Rules will display the warning: > Potentially dangerous query based on parameters set by the client. The client can send any value for these parameters so it's not a good place to do authorization. diff --git a/usage/tools/cli.mdx b/usage/tools/cli.mdx index 7e38d9b3..1e300cd3 100644 --- a/usage/tools/cli.mdx +++ b/usage/tools/cli.mdx @@ -6,7 +6,7 @@ description: "Manage your PowerSync Cloud environment programmatically" You can use the [PowerSync CLI](https://www.npmjs.com/package/powersync) to manage your PowerSync Cloud instances from your machine. Specifically, you can: * Manage your [PowerSync instances ](/architecture/powersync-service)(PowerSync Cloud) -* Validate and deploy [sync rules](/usage/sync-rules) to an instance from a local file +* Validate and deploy [Sync Rules](/usage/sync-rules) to an instance from a local file * Generate the [client-side schema](/installation/client-side-setup/define-your-schema) @@ -29,13 +29,13 @@ npx powersync init ? Enter your API token: [hidden] ``` -You need to provide an access (API) token to initialize the CLI. These can be created in the [Dashboard](/usage/tools/powersync-dashboard), using the **Create Personal Access Token** action (search for it using the [command palette](/usage/tools/powersync-dashboard#the-command-palette)). +You need to provide an access (API) token to initialize the CLI. These can be created in your [Account Settings](https://dashboard.powersync.com/profile/access-tokens) in the PowerSync Dashboard. -Use the **Revoke Personal Access Token** action to revoke access. +Here you can also revoke access by deleting the token. ### Usage -For more information on the available commands, please refer to: +For more information on the CLI's available commands, please refer to: @@ -58,12 +58,10 @@ You have following options: * **Filter options**: data by time range. -* **Granularity**: See data in a daily or hourly granularity. +* **Granularity**: See data in a daily, hourly or minute granularity. * **Aggregates**: View and copy aggregates for each usage metric. -* **CSV**: Download data as CSV for custom calculations. - This usage data is also available programmatically via APIs in an early access release. Chat to us on our [Discord](https://discord.gg/powersync) if you require details. @@ -90,7 +88,7 @@ You can review logs for your PowerSync instance(s) to troubleshoot replication o ### View Instance Logs -Access instance logs through the [Dashboard](/usage/tools/powersync-dashboard), in the **Instance logs** workspace (or by searching for the panel using the [command palette](/usage/tools/powersync-dashboard#the-command-palette)): +Access instance logs through the [PowerSync Dashboard](https://dashboard.powersync.com/). Select your project and instance and go to the **Logs** view: @@ -120,6 +118,10 @@ Issue alerts capture potential problems with your instance, such as connection o ### Configure Issue Alerts + + Issue alerts configuration is currently available in the [legacy dashboard](https://powersync.journeyapps.com/). This feature will be available in the new dashboard soon. + + Issue alerts are set up per instance. To set up a new alert, navigate to your **PowerSync Project tree**, right-click on the "Issue Alerts" option under the selected instance, and follow the prompts. @@ -138,9 +140,11 @@ You also have the option to set the severity level of the alerts. For example, y ### View Issue Alerts -Once you have created an alert, you can right-click on it to open the alert logs. The logs panel includes the option to filter alerts by date range. + + Viewing issue alerts is currently available in the [legacy dashboard](https://powersync.journeyapps.com/). This feature will be available in the new dashboard soon. + -This command and other configuration options are also available from the [command palette](/usage/tools/powersync-dashboard#the-command-palette) (SHIFT+SHIFT): +Once you have created an alert, you can right-click on it to open the alert logs. The logs panel includes the option to filter alerts by date range. @@ -162,6 +166,10 @@ Usage alerts trigger when specific usage metrics exceed a defined threshold. Thi ### Configure Usage Alerts + + Usage alerts configuration is currently available in the [legacy dashboard](https://powersync.journeyapps.com/). This feature will be available in the new dashboard soon. + + Usage alerts are set up per instance. Navigate to your **PowerSync Project** tree, and click on the plus icon for the **Usage Alerts** option under your selected instance to create a new alert. @@ -203,10 +211,11 @@ Usage alerts have the following configuration options: ### View Usage Alert Logs -Once you have created an alert, you can right-click on it to open the alert logs. The logs panel includes the option to filter alerts by date range. - -This command and other configuration options are also available from the [command palette](/usage/tools/powersync-dashboard#the-command-palette) (SHIFT+SHIFT): + + Viewing usage alert logs is currently available in the [legacy dashboard](https://powersync.journeyapps.com/). This feature will be available in the new dashboard soon. + +Once you have created an alert, you can right-click on it to open the alert logs. The logs panel includes the option to filter alerts by date range. @@ -236,6 +245,10 @@ Email notifications allow you to receive alerts directly to your email address w #### Set Up Email Notifications + + Email rules configuration is currently available in the [legacy dashboard](https://powersync.journeyapps.com/). This feature will be available in the new dashboard soon. + + Navigate to the **Email Rules** section in your **PowerSync Project** tree, and click on the plus icon to create a new email rule for your project. @@ -266,6 +279,10 @@ Webhooks enable you to notify external systems when specific events occur in Pow #### Set Up Webhooks + + Webhook configuration is currently available in the [legacy dashboard](https://powersync.journeyapps.com/). This feature will be available in the new dashboard soon. + + Navigate to the **Webhooks** section in your **PowerSync Project** tree, and click on the plus icon to create a new webhook for your project. diff --git a/usage/tools/powersync-dashboard.mdx b/usage/tools/powersync-dashboard.mdx index 6517871f..28290c79 100644 --- a/usage/tools/powersync-dashboard.mdx +++ b/usage/tools/powersync-dashboard.mdx @@ -1,166 +1,115 @@ --- title: "PowerSync Dashboard" -description: "Introduction to and overview of the PowerSync Dashboard and Admin Portal" +description: "Introduction to and overview of the PowerSync Dashboard" --- -The PowerSync Dashboard is available in [PowerSync Cloud](https://www.powersync.com/pricing) (our cloud-hosted offering) and provides an interface for developers to: - -- Manage PowerSync projects -- Manage PowerSync instances -- Write, validate and deploy [sync rules](/usage/sync-rules) -- Generate the [client-side schema](/installation/client-side-setup/define-your-schema) -- Generate [development tokens](/installation/authentication-setup/development-tokens) -- Monitor usage and configure alerts - see [Monitoring and Alerting](/usage/tools/monitoring-and-alerting) -- Review instance logs - see [Monitoring and Alerting](/usage/tools/monitoring-and-alerting) +The PowerSync Dashboard is available in [PowerSync Cloud](https://www.powersync.com/pricing) (our cloud-hosted offering) and provides an interface for managing your PowerSync organization, projects, instances, and account settings. The dashboard is available here: https://dashboard.powersync.com/ We have rebuilt the dashboard from the ground up for improved performance and usability. - We are actively working on migrating a few remaining features and polishing the experience, including updating the below docs to reflect the new dashboard. + We are actively working on migrating a few remaining features and polishing the experience. - If you run into blocking issues, you can still access the legacy dashboard and admin portal: [https://powersync.journeyapps.com/](https://powersync.journeyapps.com/). + If you run into blocking issues, you can still access the legacy dashboard: [https://powersync.journeyapps.com/](https://powersync.journeyapps.com/). Please reach out to us on [Discord](https://discord.gg/powersync) if you need help or have feedback. ### Hierarchy: Organization, project, instance -- After successfully [signing up](https://accounts.journeyapps.com/portal/powersync-signup?s=docs) for PowerSync Cloud, your PowerSync account is created. +- After successfully [signing up](https://accounts.journeyapps.com/portal/powersync-signup?s=docs) for PowerSync Cloud, your **PowerSync account** is created. - Your account is assigned an **organization** on the [Free pricing plan](https://www.powersync.com/pricing). -- A sample PowerSync **project** (named "PowerSync Project") is automatically created in this organization, and this project is your starting point after completing sign-up. It is opened by default in the dashboard: +- To get started, you'll need to create a **project** in your organization. - - ![](/images/usage/tools/dashboard-overview.png) + + ![](/images/usage/tools/dashboard-org-level.png) -- Within a project, you can create and manage one or more PowerSync **instances** for your project (typically developers maintain a staging and production instance). An instance runs a copy of the [PowerSync Service](/architecture/powersync-service) and connects to your [backend database](/installation/database-connection). +When you click "Create a New Project", you can opt to create a _Development_ and _Production_ **instance** automatically for that project (recommended). An instance runs a copy of the [PowerSync Service](/architecture/powersync-service) and connects to your [backend database](/installation/database-connection). You can also update region for each instance from US to EU, JP (Japan), AU (Australia) or BR (Brazil). + + + ![](/images/usage/tools/dashboard-create-project.png) + Here is an example of how this hierarchy might be used by a customer: - **Organization**: Wanderlust Inc. - **Project**: Wanderlust Tracker - - **Instance**: Staging + - **Instance**: Development - **Instance**: Production -### Dashboard layout - -The Dashboard layout is similar to that of an IDE and includes the following main components: - -- [Workspaces](/usage/tools/powersync-dashboard#workspaces) -- [Editor Panes, Panels and Files](/usage/tools/powersync-dashboard#editor-panes-panels-and-files) -- [The Command Palette](/usage/tools/powersync-dashboard#the-command-palette) -- [Actions](/usage/tools/powersync-dashboard#actions) - - - ![](/images/usage/tools/dashboard-components.png) - - -#### Workspaces +### Dashboard Overview -Workspaces are a pre-configured logical collection of editor panes and panels that are designed to make working on a specific part of your project as easy as possible. +The PowerSync Dashboard is organized into three main levels, each providing different functionality: -The dashboard comes with four workspaces by default: **Overview**, **Manage instances**, **Usage metrics** and **Instance logs**. +1. **Organization Level** - Manage projects, team members, organization and billingsettings +2. **Account Level** - Manage your personal account settings and access tokens +3. **Project & Instance Level** - Configure and monitor your PowerSync instances -- The **Overview** workspace displays a summary of your PowerSync instances, or guides you through creating your first instance. -- The **Manage instances** workspace is allows you to create, view and update PowerSync instances, validate and deploy sync rules, and view deploy logs for each instance. -- The **Usage metrics** workspace displays your project's usage metrics by instance. -- The **Instance logs** workspace displays replication and service logs by instance. +### Organization Level -You can customize any of these workspaces (changes save automatically) and/or create new workspaces. +URL structure: `https://dashboard.powersync.com/org/{orgId}/projects` -To reset all workspaces to their original layout, run the **Reset workspaces** action (see _Command Palette_ and _Actions_ below for how to run actions). +At the organization level, you can manage your PowerSync projects and organization-wide settings. Navigate to your organization to access: -#### Editor Panes, Panels and Files +- **Projects** - View all projects in your organization, create new projects, and manage project settings +- **Team** - Invite team members to your organization, manage user roles, and remove access +- **Plans & Billing** - View or update your PowerSync subscription plan and manage billing details +- **Plan Usage** - Monitor usage metrics across all projects in your organization for the current billing cycle +- **Settings** - Update the organization name -Editor Panes are used to interact with your project's files (e.g. `sync-rules.yaml`) and Panels display information about your project in components that can be positioned and resized. +### Account Level -#### The Command Palette +URL structure: `https://dashboard.powersync.com/profile/general` -Open the Command Palette using the keyboard shortcut `CTRL/CMD+SHIFT+P` or `SHIFT+SHIFT`, and access just about anything you need to do in your project. +At the account level, you can manage your personal account settings: -#### Actions +- **Account Details** - View your account email and name +- **Security** - Reset your password and configure multi-factor authentication +- **Access Tokens** - Create and manage personal access tokens for use with the [CLI](/usage/tools/cli) -The various actions available in your project are accessible via the Command Palette, by right-clicking on certain items, and via buttons. These are a few of the most common actions you might need during the lifecycle of your PowerSync project (you can search them via the Command Palette): +### Project & Instance Level -- **Generate development token** -\> Generate a [development token](/installation/authentication-setup/development-tokens) for authentication -- **Generate client-side schema** -\> Generate the [client-side schema](/installation/client-side-setup/define-your-schema) for an instance based off your [sync rules](/usage/sync-rules). -- **Validate sync rules** -\> Validate the [sync rules](/usage/sync-rules) defined in your `sync-rules.yaml` against an instance. -- **Deploy sync rules** -\> Deploy [sync rules](/usage/sync-rules) as defined in your `sync-rules.yaml` file to an instance. -- **Compare deployed sync rules** -\> Compare the [sync rules](/usage/sync-rules) as defined in your `sync-rules.yaml` file with those deployed to an instance. -- **Save changes** -\> Save changes to files as a revision when in **Basic Revisions** version control mode (see _Version Control_ below) - - Or **Commit changes** -\> Commit changes to files when in **Advanced Git** version control mode. -- **Compact buckets** -\> Manually [compact](/usage/lifecycle-maintenance/compacting-buckets) and optionally [defragment](/usage/lifecycle-maintenance/compacting-buckets#defragmenting) sync buckets of an instance. -- **Create Personal Access Token** -\> Create an access token scoped to your user, which is needed for the [CLI](/usage/tools/cli). -- **Rename project** -\> Rename your PowerSync project. +URL structure: `https://dashboard.powersync.com/org/{orgId}/project/{projectId}/{instanceId}/{view}` -### Dashboard Settings +When you navigate to a specific instance, you'll see a left sidebar with various views for configuring and monitoring that instance: -To customize your dashboard experience, access the **IDE Settings** panel through the Command Palette or by clicking the gear icon located in the top-right corner of the dashboard. This panel allows you to modify core preferences, including the dashboard's theme and the display format for dates and times. +- **Health** - Overview of its connection health, deploy history, replication status, and recently connected clients +- **Database Connections** - Configure and manage the source database connection +- **Client Auth** - Configure authentication settings +- **Sync Rules** - Edit, validate, and deploy your Sync Rules +- **Sync Test** - Test your Sync Rules configuration +- **Client SDK Setup** - Generate the [client-side schema](/installation/client-side-setup/define-your-schema) based off your [Sync Rules](/usage/sync-rules) +- **Write API** - Resources for exposing the write API endpoint +- **Logs** - View replication and service logs +- **Metrics** - Monitor usage metrics and performance +- **Settings** - Advanced options such as [compacting or defragmenting sync buckets](/usage/lifecycle-maintenance/compacting-buckets) using the **Compact** and **Defragment** buttons, and managing instance lifecycle with the **Deprovision instance** and **Destroy instance** buttons in the Danger zone -### Version Control +In the top bar, you'll see a "Connect" button that provides quick access to your instance URL and other resources for connecting to your instance. -Your PowerSync projects come with version control built-in. This is useful when working with your project's sync rules file (`sync-rules.yaml`). The default mode is **Basic Revisions**, which allows you to save, view and revert to revisions of your sync rules file. Another mode is **Advanced Git**, which enables a git-based workflow, including commits, branching, and merging. The modes can be toggled for your projects in the Admin Portal (see [below](/usage/tools/powersync-dashboard#admin-portal)). - -#### Saving/committing changes + + ![](/images/usage/tools/dashboard-connect-button.png) + -Open the **Changes** panel (find it via the Command Palette) to review any changes and save, or revert to a specific revision/commit. +#### Common Tasks -#### GitHub / Azure Repos integration +Here are some of the most common tasks you'll perform in the dashboard: -The default git provider for projects is our own "JourneyApps" system which does not require any configuration from the developer. It is also possible to use either GitHub or Azure DevOps as your git provider. For this to work, an integration must be added to your organization via the Admin Portal. Read on to learn more. +- **Edit and deploy Sync Rules** - Select your project and instance and go to the **Sync Rules** view to edit your Sync Rules, then click **"Validate"** and **"Deploy"** to deploy them +- **Generate development token** - Navigate to the **Client Auth** and ensure the "Enable development tokens" setting is set. Click the "Connect" button in the top bar and follow instructions to generate a [development token](/installation/authentication-setup/development-tokens). +- **Launch the Sync Diagnostics Client** - Navigate to the **Sync Test**, generate a development token and click "Launch" to launch the [Sync Diagnostics Client](/resources/troubleshooting#sync-diagnostics-client). +- **Copy your instance URL** - Click **Connect** in the top bar and copy the instance URL from the dialog. +- **Generate client-side schema** - Click the **Connect** button in the top bar to generate the [client-side schema](/installation/client-side-setup/define-your-schema) based on your [Sync Rules](/usage/sync-rules) in your preferred language +- **Monitor instance health** - Navigate to the **Health** view to see an overview of your instance status, database connections, and recent deploys +- **View logs** - Navigate to the **Logs** view to review replication and client sync logs +- **Monitor metrics** - Navigate to the **Metrics** view to track usage metrics -### Advanced: Service Version Locking +#### Advanced: Service Version Locking Customers on our [Team and Enterprise plans](https://www.powersync.com/pricing) can lock their PowerSync Cloud instances to a specific version of the PowerSync Service. This option is available under your instance settings. Versions are specified as `major.minor.patch`. When locked, only new `.patch` releases will automatically be applied to the instance. **Downgrade limitations:** Not all downgrade paths are available automatically. If you need to downgrade to an older version, please [contact our team](/resources/contact-us) for assistance. - -### Admin Portal - -In the Admin Portal you can [manage your PowerSync projects](/usage/tools/powersync-dashboard#manage-powersync-projects), [users](/usage/tools/powersync-dashboard#manage-users) and [integrations](/usage/tools/powersync-dashboard#manage-integrations). - -It is available here: - -https://accounts.journeyapps.com/portal/admin/ - - - When in the PowerSync Dashboard, you can also click on the PowerSync icon in the top-left corner to navigate to the Admin Portal. - - - - ![](/images/usage/tools/admin-portal.avif) - - - - **Advanced permissions**: Several functions in the Admin Portal require advanced permissions that you do not have by default after signing up. Please [contact us](/resources/contact-us) to request these permissions. This is a temporary limitation that will be removed in a future release. - - -#### Manage PowerSync projects - -In the "Projects" tab, new projects can be created, existing projects can be deleted, and the [version control](/usage/tools/powersync-dashboard#version-control) mode can be changed for a project. If your project uses the **Advanced Git** version control mode, the git provider can also be configured here. - -#### Manage users - -Select the "Developers" tab to invite team members to your organization or remove their access. Only users with the **Owner** role can manage users. - -#### Manage integrations - -In the "Integrations" tab, [GitHub or Azure DevOps integrations](/usage/tools/powersync-dashboard#github-azure-repos-integration) can be added in order to configure them as git providers for your project(s). - -#### Update organization settings - -In the "Settings" tab, you can rename your organization. - -#### Update billing details - -In the "Billing" tab, you can update your billing details and manage payment cards. - -**View subscriptions** - -In the "Subscriptions" tab, you can view your active subscription and usage. - -See [Pricing](https://www.powersync.co/pricing) for available subscription plans. \ No newline at end of file diff --git a/usage/use-case-examples/postgis.mdx b/usage/use-case-examples/postgis.mdx index b766c573..35de764b 100644 --- a/usage/use-case-examples/postgis.mdx +++ b/usage/use-case-examples/postgis.mdx @@ -55,19 +55,14 @@ Note the following: * `st_point(39.742043, -104.991531)` -### What this data looks like when querying from the PowerSync Dashboard +### What this data looks like in Postgres -These data types show up as follows when querying from the [PowerSync Dashboard](https://powersync.journeyapps.com/)'s SQL Query editor: - -```sql -SELECT * from todos WHERE location IS NOT NULL -``` +Postgres' internal binary representation of the PostGIS type is as follows: | location | | -------------------------------------------------- | | 0101000020E6100000E59CD843FBDE4340E9818FC18AC052C0 | -This is Postgres' internal binary representation of the PostGIS type. ## On the Client @@ -124,7 +119,7 @@ The data looks exactly how it’s stored in the Postgres database i.e. Example use case: Extract x (long) and y (lat) values from a PostGIS type, to use these values independently in an application. -Currently, PowerSync supports the following functions that can be used when selecting data in your sync rules: [Operators and Functions](/usage/sync-rules/operators-and-functions) +Currently, PowerSync supports the following functions that can be used when selecting data in your Sync Rules: [Operators and Functions](/usage/sync-rules/operators-and-functions) 1. `ST_AsGeoJSON` 2. `ST_AsText` diff --git a/usage/use-case-examples/prioritized-sync.mdx b/usage/use-case-examples/prioritized-sync.mdx index 9dad89bd..be111bd7 100644 --- a/usage/use-case-examples/prioritized-sync.mdx +++ b/usage/use-case-examples/prioritized-sync.mdx @@ -58,7 +58,7 @@ Note: - Priorities must be static and cannot depend on row values within a parameter query. -Your Sync Rules file in the PowerSync Dashboard may show a "must NOT have additional properties" error which can safely be ignored. Your Sync Rules should still pass validation. We will improve this error in a future release. +Your Sync Rules in the PowerSync Dashboard may show a "must NOT have additional properties" error which can safely be ignored. Your Sync Rules should still pass validation. We will improve this error in a future release. # Example: Syncing Lists Before Todos