diff --git a/client/www/app/docs/auth/apple/[[...tab]]/page.md b/client/www/app/docs/auth/apple/[[...tab]]/page.md
index ef03f9823f..b8d49cf016 100644
--- a/client/www/app/docs/auth/apple/[[...tab]]/page.md
+++ b/client/www/app/docs/auth/apple/[[...tab]]/page.md
@@ -12,7 +12,7 @@ Instant supports Sign In with Apple on the Web and in native applications.
{% nav-group %}
{% nav-button param="method" value="web-popup" title="Web Popup (recommended)" description="Use Apple-provided popup to authenticate users" /%}
{% nav-button param="method" value="web-redirect" title="Web Redirect" description="Use redirect flow to authenticate users" /%}
-{% nav-button param="method" value="native" title="React Native" description="Authenticating in React Native app" /%}
+{% nav-button param="method" value="native" title="React Native" description="Authenticate in a React Native app" /%}
{% /nav-group %}
## Step 1: Create App ID
@@ -38,12 +38,12 @@ Instant supports Sign In with Apple on the Web and in native applications.
## Step 3: Configure Services ID (Web Popup flow)
-- Select newly created Services ID
+- Select the newly created Services ID
- Enable _Sign In with Apple_
- Click _Configure_
- Select _Primary App ID_ from Step 1
- To _Domains_, add your app domain (e.g. `myapp.com`)
-- To _Return URLs_, add URL of your app where authentication happens (e.g. `https://myapp.com/signin`)
+- To _Return URLs_, add the URL of your app where authentication happens (e.g. `https://myapp.com/signin`)
- Click _Continue_ → _Save_
{% /conditional %}
@@ -52,7 +52,7 @@ Instant supports Sign In with Apple on the Web and in native applications.
## Step 3: Configure Services ID (Web Redirect flow)
-- Select newly created Services ID
+- Select the newly created Services ID
- Enable _Sign In with Apple_
- Click _Configure_
- Select _Primary App ID_ from Step 1
@@ -231,7 +231,7 @@ const authUrl = db.auth.createAuthorizationURL({
});
```
-Add a link uses `authUrl`:
+Add a link that uses `authUrl`:
```
Sign In with Apple
@@ -244,7 +244,7 @@ That’s it!
## Step 5: Add Sign In code to your app (React Native flow)
-Instant comes with support for [Expo AppleAuthentication library](https://docs.expo.dev/versions/latest/sdk/apple-authentication/).
+Instant comes with support for the [Expo AppleAuthentication library](https://docs.expo.dev/versions/latest/sdk/apple-authentication/).
Add dependency:
diff --git a/client/www/app/docs/auth/clerk/page.md b/client/www/app/docs/auth/clerk/page.md
index 7d78245be6..6eb0375a14 100644
--- a/client/www/app/docs/auth/clerk/page.md
+++ b/client/www/app/docs/auth/clerk/page.md
@@ -30,7 +30,7 @@ You can have additional claims as long as the `email` claim is set to `{{user.pr
On the Clerk dashboard, navigate to [`API keys`](https://dashboard.clerk.com/last-active?path=api-keys), then copy the `Publishable key`. It should start with `pk_`.
-**Step 3: Register your Clerk Publishable key with your instant app**
+**Step 3: Register your Clerk Publishable key with your Instant app**
{% setup-paths %}
@@ -55,9 +55,9 @@ npx instant-cli@latest auth client add \
Use Clerk's `getToken` helper to get a session JWT for your signed-in user. Then call Instant's `db.auth.signInWithIdToken` with the JWT and the client name you set on the Instant dashboard.
-When you call `db.auth.signInWithIdToken`, Instant will verify that the JWT was signed by your Clerk app. If verified, Instant will use the email in the JWT's claims to lookup your user or create a new one and create a long-lived session. Be sure to call Instant's `db.auth.signOut` when you want to sign the user out.
+When you call `db.auth.signInWithIdToken`, Instant will verify that the JWT was signed by your Clerk app. If verified, Instant will use the email in the JWT's claims to look up your user or create a new one and create a long-lived session. Be sure to call Instant's `db.auth.signOut` when you want to sign the user out.
-Here is a full example using clerk's next.js library:
+Here is a full example using Clerk's Next.js library:
```javascript {% showCopy=true %}
'use client';
diff --git a/client/www/app/docs/auth/firebase/page.md b/client/www/app/docs/auth/firebase/page.md
index 7967394c98..7b10523992 100644
--- a/client/www/app/docs/auth/firebase/page.md
+++ b/client/www/app/docs/auth/firebase/page.md
@@ -11,9 +11,9 @@ Instant supports delegating auth to Firebase Auth.
**Step 1: Get your Firebase Project ID**
-On the [Firebase dashboard](https://console.firebase.google.com/), open your project and navigate to navigate to `Project Overview` > `⚙` > `Project Settings`, then copy the `Project ID`.
+On the [Firebase dashboard](https://console.firebase.google.com/), open your project and navigate to `Project Overview` > `⚙` > `Project Settings`, then copy the `Project ID`.
-**Step 2: Register your Firebase Project ID with your instant app**
+**Step 2: Register your Firebase Project ID with your Instant app**
{% setup-paths %}
@@ -38,7 +38,7 @@ npx instant-cli@latest auth client add \
Use Firebase's `getIdToken` helper to get a JWT for your signed-in user. Then call Instant's `db.auth.signInWithIdToken` with the JWT and the client name you set on the Instant dashboard.
-When you call `db.auth.signInWithIdToken`, Instant will verify that the JWT was signed by your Firebase app. If verified, Instant will use the email in the JWT's claims to lookup your user or create a new one and create a long-lived session. Be sure to call Instant's `db.auth.signOut` when you want to sign the user out.
+When you call `db.auth.signInWithIdToken`, Instant will verify that the JWT was signed by your Firebase app. If verified, Instant will use the email in the JWT's claims to look up your user or create a new one and create a long-lived session. Be sure to call Instant's `db.auth.signOut` when you want to sign the user out.
Here is a full example:
diff --git a/client/www/app/docs/auth/github-oauth/[[...tab]]/page.md b/client/www/app/docs/auth/github-oauth/[[...tab]]/page.md
index d6841c1378..60872f6a65 100644
--- a/client/www/app/docs/auth/github-oauth/[[...tab]]/page.md
+++ b/client/www/app/docs/auth/github-oauth/[[...tab]]/page.md
@@ -123,7 +123,7 @@ And voila, you are connected!
**Method: Web Redirect**
-Create an authorization URL via `db.auth.createAuthorizationURL` and then use the url to create a link. Here's a full example:
+Create an authorization URL via `db.auth.createAuthorizationURL` and then use the URL to create a link. Here's a full example:
```jsx {% showCopy=true %}
'use client';
@@ -204,7 +204,7 @@ Update your app.json with your scheme:
**Register your app with Instant**
-Now that you have your App Scheme, it's time to tell Instant about it. For development with expo, add `exp://` and your scheme (e.g. `mycoolredirect://`) as redirect origins.
+Now that you have your App Scheme, it's time to tell Instant about it. For development with Expo, add `exp://` and your scheme (e.g. `mycoolredirect://`) as redirect origins.
{% setup-paths %}
@@ -229,7 +229,7 @@ npx instant-cli@latest auth origin add --type custom-scheme --scheme mycoolredir
**Use AuthSession to log in with GitHub!**
-And from here you're ready to add a login button to your expo app! Here's a full example:
+And from here you're ready to add a login button to your Expo app! Here's a full example:
```jsx {% showCopy=true %}
import { View, Text, Button } from 'react-native';
diff --git a/client/www/app/docs/auth/google-oauth/[[...tab]]/page.md b/client/www/app/docs/auth/google-oauth/[[...tab]]/page.md
index bf959541d8..3167d3934b 100644
--- a/client/www/app/docs/auth/google-oauth/[[...tab]]/page.md
+++ b/client/www/app/docs/auth/google-oauth/[[...tab]]/page.md
@@ -24,7 +24,7 @@ Choose the option that sounds best to you, and the rest of the document will sho
recommended=true /%}
{% nav-button
title="Web Redirect"
- description="Easier to integrate, but requires a redirect rule to render your custom app name."
+ description="Easier to integrate but requires a redirect rule to render your custom app name."
param="method"
value="web-redirect" /%}
{% /div %}
@@ -34,7 +34,7 @@ Choose the option that sounds best to you, and the rest of the document will sho
{% div className="grid grid-cols-2 md:grid-cols-1 md:grid-rows-2 flex-1 gap-4" %}
{% nav-button
title="Native Auth"
- description="Use a 'react-native-google-signin', to integrate with the native Google iOS and Android flows. Lets you render your custom app name in the consent screen"
+ description="Use react-native-google-signin to integrate with the native Google iOS and Android flows and render your custom app name in the consent screen."
param="method"
value="rn-native"
recommended=true /%}
@@ -52,11 +52,11 @@ Choose the option that sounds best to you, and the rest of the document will sho
There are three main steps:
-1. **Google Console**: Set up your consent screen and create an Oauth client.
-2. **Instant Dashboard**: Connect your Oauth client to Instant
+1. **Google Console**: Set up your consent screen and create an OAuth client.
+2. **Instant Dashboard**: Connect your OAuth client to Instant
3. **Your app**: Add some code to log in with Google!
-Let's dive deeper in each step:
+Let's dive deeper into each step:
{% conditional
param="method"
@@ -102,7 +102,7 @@ Developer credentials are meant only for local development. You're limited to 10
{% /conditional %}
-## 1. Set up your consent screen and create an Oauth client
+## 1. Set up your consent screen and create an OAuth client
Head on over to {% blank-link href="https://console.cloud.google.com/apis/credentials" label="Google Console" /%}. You should be in the "Credentials" section.
@@ -134,11 +134,11 @@ Head on over to {% blank-link href="https://console.cloud.google.com/apis/creden
-And with that you have your Oauth client!
+And with that you have your OAuth client!
{% callout type="note" %}
-Save your Client ID and your Client Secret -- you'll need it for the next step!
+Save your Client ID and your Client Secret -- you'll need them for the next step!
{% /callout %}
@@ -148,7 +148,7 @@ Save your Client ID and your Client Secret -- you'll need it for the next step!
param="method"
value=["rn-native"] %}
-For native auth, each platform needs an Oauth Client. If you support both iOS or Android for example, you'll create two clients. Here are the steps:
+For native auth, each platform needs an OAuth Client. If you support both iOS and Android, for example, you'll create two clients. Here are the steps:
- From Google Console, click "+ CREATE CREDENTIALS"
- Select "OAuth client ID"
@@ -159,19 +159,19 @@ And with that you're ready!
{% callout type="note" %}
-Save your Client IDs -- you'll need it for the next step!
+Save your Client IDs -- you'll need them for the next step!
{% /callout %}
{% /conditional %}
-## 2. Connect your Oauth client to Instant
+## 2. Connect your OAuth client to Instant
{% conditional
param="method"
value=["web-google-button", "web-redirect", "rn-web"] %}
-**Add your Oauth Client on Instant**
+**Add your OAuth Client on Instant**
{% setup-paths %}
@@ -233,9 +233,9 @@ npx instant-cli@latest auth origin add --type website --url
param="method"
value=["rn-native"] %}
-**Add your Oauth Client on Instant**
+**Add your OAuth Client on Instant**
-For each Oauth Client you created, add it to Instant:
+For each OAuth Client you created, add it to Instant:
{% setup-paths %}
@@ -353,7 +353,7 @@ function Login() {
**Not using React?**
-If you're not using React or prefer to embed the button yourself, refer to {% blank-link href="https://developers.google.com/identity/gsi/web/guides/overview" label="Google's docs" /%} on how to create the button and load their client library
+If you're not using React or prefer to embed the button yourself, refer to {% blank-link href="https://developers.google.com/identity/gsi/web/guides/overview" label="Google's docs" /%} on how to create the button and load their client library.
When creating your button, make sure to set the `data-ux_mode="popup"`. Your `data-callback` function should look like:
@@ -375,9 +375,9 @@ async function handleSignInWithGoogle(response) {
**Method: Web Redirect**
-If you don't want to use the google styled buttons, you can use the redirect flow instead.
+If you don't want to use the Google-styled buttons, you can use the redirect flow instead.
-Create an authorization URL via `db.auth.createAuthorizationURL` and then use the url to create a link. Here's a full example:
+Create an authorization URL via `db.auth.createAuthorizationURL` and then use the URL to create a link. Here's a full example:
```jsx {% showCopy=true %}
'use client';
@@ -460,7 +460,7 @@ Update your app.json with your scheme:
**Register your app with Instant**
-Now that you have your App Scheme, it's time to tell Instant about it. For development with expo, add `exp://` and your scheme (e.g. `mycoolredirect://`) as redirect origins.
+Now that you have your App Scheme, it's time to tell Instant about it. For development with Expo, add `exp://` and your scheme (e.g. `mycoolredirect://`) as redirect origins.
{% setup-paths %}
@@ -485,7 +485,7 @@ npx instant-cli@latest auth origin add --type custom-scheme --scheme mycoolredir
**Use AuthSession to log in with Google!**
-And from here you're ready to add a login button to your expo app! Here's a full example
+And from here you're ready to add a login button to your Expo app! Here's a full example:
```jsx {% showCopy=true %}
import { View, Text, Button, StyleSheet } from 'react-native';
@@ -573,7 +573,7 @@ export default App;
**Method: Native Auth**
-You can use [react-native-google-signin/google-signin](https://github.com/react-native-google-signin/google-signin), to authenticate natively on Google.
+You can use [react-native-google-signin/google-signin](https://github.com/react-native-google-signin/google-signin) to authenticate natively on Google.
There are three steps:
@@ -595,7 +595,7 @@ Then, follow the google-signin {% blank-link href="https://react-native-google-s
**Use google-signin to log in with Google!**
-Now you're ready to add the Google Signin button to your expo app! Here's a full example:
+Now you're ready to add the Google sign-in button to your Expo app! Here's a full example:
```jsx {% showCopy=true %}
import { View, Text, Button, StyleSheet } from 'react-native';
@@ -646,7 +646,7 @@ function Login() {
console.error('no ID token present!');
return;
}
- // 2. Use your token, and sign into InstantDB!
+ // 2. Use your token to sign in to InstantDB!
try {
const res = await db.auth.signInWithIdToken({
// The unique name you gave the OAuth client when you
diff --git a/client/www/app/docs/auth/guest-auth/page.md b/client/www/app/docs/auth/guest-auth/page.md
index 1f465898f1..5497affbfd 100644
--- a/client/www/app/docs/auth/guest-auth/page.md
+++ b/client/www/app/docs/auth/guest-auth/page.md
@@ -9,7 +9,7 @@ Instant supports guest authentication. This allows your users to try your app be
## Signing in as a Guest
-Use `db.auth.signInAsGuest()` to create a new guest user. This will create a new guest user with an id, but no email address.
+Use `db.auth.signInAsGuest()` to create a new guest user. This will create a new guest user with an ID but no email address.
You can set custom `$users` properties when creating the guest by passing `extraFields`:
diff --git a/client/www/app/docs/auth/linkedin-oauth/[[...tab]]/page.md b/client/www/app/docs/auth/linkedin-oauth/[[...tab]]/page.md
index eb89aaae27..1de165f27b 100644
--- a/client/www/app/docs/auth/linkedin-oauth/[[...tab]]/page.md
+++ b/client/www/app/docs/auth/linkedin-oauth/[[...tab]]/page.md
@@ -40,13 +40,13 @@ Choose the option that sounds best to you, and the rest of the document will sho
There are three main steps:
-1. **LinkedIn Developer Console**: Create an Oauth client.
-2. **Instant Dashboard**: Connect your Oauth client to Instant
+1. **LinkedIn Developer Console**: Create an OAuth client.
+2. **Instant Dashboard**: Connect your OAuth client to Instant
3. **Your app**: Add some code to log in with LinkedIn!
-Let's dive deeper in each step:
+Let's dive deeper into each step:
-## 1. Create an Oauth client
+## 1. Create an OAuth client
1. Head to the [LinkedIn developer portal](https://www.linkedin.com/developers/apps) and create a new application (or open an existing one).
2. In the **Auth** tab enable **Sign In with LinkedIn**.
@@ -58,13 +58,13 @@ https://api.instantdb.com/runtime/oauth/callback
{% callout type="note" %}
-Save your Client ID and your Client Secret -- you'll need it for the next step!
+Save your Client ID and your Client Secret -- you'll need them for the next step!
{% /callout %}
-## 2. Connect your Oauth client to Instant
+## 2. Connect your OAuth client to Instant
-**Add your Oauth Client on Instant**
+**Add your OAuth Client on Instant**
{% setup-paths %}
@@ -126,7 +126,7 @@ And voila, you are connected!
**Method: Web Redirect**
-Create an authorization URL via `db.auth.createAuthorizationURL` and then use the url to create a link. Here's a full example:
+Create an authorization URL via `db.auth.createAuthorizationURL` and then use the URL to create a link. Here's a full example:
```jsx {% showCopy=true %}
'use client';
@@ -209,7 +209,7 @@ Update your app.json with your scheme:
**Register your app with Instant**
-Now that you have your App Scheme, it's time to tell Instant about it. For development with expo, add `exp://` and your scheme (e.g. `mycoolredirect://`) as redirect origins.
+Now that you have your App Scheme, it's time to tell Instant about it. For development with Expo, add `exp://` and your scheme (e.g. `mycoolredirect://`) as redirect origins.
{% setup-paths %}
@@ -234,7 +234,7 @@ npx instant-cli@latest auth origin add --type custom-scheme --scheme mycoolredir
**Use AuthSession to log in with LinkedIn!**
-And from here you're ready to add a login button to your expo app! Here's a full example
+And from here you're ready to add a login button to your Expo app! Here's a full example:
```jsx {% showCopy=true %}
import { View, Text, Button, StyleSheet } from 'react-native';
diff --git a/client/www/app/docs/auth/magic-codes/[[...tab]]/page.md b/client/www/app/docs/auth/magic-codes/[[...tab]]/page.md
index fb3cc7857b..89bd2acd8e 100644
--- a/client/www/app/docs/auth/magic-codes/[[...tab]]/page.md
+++ b/client/www/app/docs/auth/magic-codes/[[...tab]]/page.md
@@ -26,7 +26,7 @@ Choose the platform you're building for to see a full example.
value="react-native" /%}
{% nav-button
title="Vanilla JS"
- description="For non-react based frameworks"
+ description="For non-React-based frameworks"
param="platform"
value="vanilla" /%}
{% /div %}
@@ -414,11 +414,11 @@ Make sure you have a `` element in your HTML.
**Let's dig deeper.**
-We created a login flow to handle magic code auth. Of note is `auth.sendMagicCode`
+We created a login flow to handle magic code auth. Of note are `auth.sendMagicCode`
and `auth.signInWithMagicCode`.
On successful validation, Instant's backend will return a user object with a refresh token.
-The client SDK will then restart the websocket connection with Instant's sync layer and provide the refresh token.
+The client SDK will then restart the WebSocket connection with Instant's sync layer and provide the refresh token.
When doing queries or transactions, the refresh token will be used to hydrate `auth`
on the backend during permission checks.
@@ -434,7 +434,7 @@ db.auth.sendMagicCode({ email }).catch((err) => {
});
```
-Use `auth.sendMagicCode` to generate a magic code on instant's backend and email it to the user.
+Use `auth.sendMagicCode` to generate a magic code on Instant's backend and email it to the user.
## Sign in with Magic Code
diff --git a/client/www/app/docs/auth/page.md b/client/www/app/docs/auth/page.md
index 49e8e8852e..30696cbb43 100644
--- a/client/www/app/docs/auth/page.md
+++ b/client/www/app/docs/auth/page.md
@@ -5,7 +5,7 @@ nextjs:
description: 'Instant supports magic code, OAuth, Clerk, and custom auth.'
---
-Instant comes with support for auth. We currently offer [Magic Codes](/docs/auth/magic-codes), [Guest Auth](/docs/auth/guest-auth), [Google OAuth](/docs/auth/google-oauth), [Sign In with Apple](/docs/auth/apple), [Github OAuth](/docs/auth/github-oauth), [LinkedIn OAuth](/docs/auth/linkedin-oauth), and [Clerk](/docs/auth/clerk). If you want to build your own flow, you can use the [Admin SDK](/docs/backend#custom-auth).
+Instant comes with support for auth. We currently offer [Magic Codes](/docs/auth/magic-codes), [Guest Auth](/docs/auth/guest-auth), [Google OAuth](/docs/auth/google-oauth), [Sign In with Apple](/docs/auth/apple), [GitHub OAuth](/docs/auth/github-oauth), [LinkedIn OAuth](/docs/auth/linkedin-oauth), and [Clerk](/docs/auth/clerk). If you want to build your own flow, you can use the [Admin SDK](/docs/backend#custom-auth).
## Auth Overview
@@ -21,7 +21,7 @@ function Dashboard() {
}
```
-The `useUser` hook will throw an error if it is accessed while the user is not logged in, so it should be gated behind ``
+The `useUser` hook will throw an error if it is accessed while the user is not logged in, so it should be gated behind ``.
```tsx
import db from '../lib/db';
@@ -102,7 +102,7 @@ function Login() {
}
```
-To implement a login flow use one of the authentication method guides below.
+To implement a login flow, use one of the authentication method guides below.
## Authentication Methods
@@ -124,8 +124,8 @@ To implement a login flow use one of the authentication method guides below.
description="Sign In to native apps with Apple ID."
/%}
{% nav-button href="/docs/auth/github-oauth"
- title="Github OAuth"
- description="Log in with Github on both Web and React Native."
+ title="GitHub OAuth"
+ description="Log in with GitHub on both Web and React Native."
/%}
{% nav-button href="/docs/auth/linkedin-oauth"
title="LinkedIn OAuth"
@@ -148,12 +148,12 @@ To implement a login flow use one of the authentication method guides below.
## Additional Auth APIs
-Sometimes you need finer control over the state of auth in your application. In those cases, you can use some of the lower-level API.
+Sometimes you need finer control over the state of auth in your application. In those cases, you can use some of the lower-level APIs.
### useAuth
Use `useAuth` to fetch the current user. In this example we guard against loading
-our `Main` component until a user is logged in
+our `Main` component until a user is logged in:
```javascript
function App() {
diff --git a/client/www/app/docs/auth/platform-oauth/page.md b/client/www/app/docs/auth/platform-oauth/page.md
index 8b1e61d68f..670deb676c 100644
--- a/client/www/app/docs/auth/platform-oauth/page.md
+++ b/client/www/app/docs/auth/platform-oauth/page.md
@@ -7,7 +7,7 @@ nextjs:
Instant supports the standard OAuth 2.0 Authorization Code grant flow, enabling users to authorize your application to access their Instant data and perform actions on their behalf, like reading app details or managing apps.
-This guide walks you through the steps required to integrate your application with Instant using OAuth. You can also [walk-through a demo](/labs/oauth_apps_demo) to see it in action.
+This guide walks you through the steps required to integrate your application with Instant using OAuth. You can also [walk through a demo](/labs/oauth_apps_demo) to see it in action.
## OAuth flow
@@ -48,7 +48,7 @@ https://api.instantdb.com/platform/oauth/start
- `response_type` (Required): Must be set to `code`.
- `redirect_uri` (Required): One of the exact Authorized Redirect URIs you registered for your client in Step 1.
- `scope` (Required): A space-separated list of permissions your application is requesting. Available scopes are:
- - `apps-read`: Allows listing user's apps and viewing their schema/permissions.
+ - `apps-read`: Allows listing the user's apps and viewing their schema/permissions.
- `apps-write`: Allows creating/deleting apps and updating schema/permissions.
- `state` (Required): A random, opaque string generated by your application. This value is used to prevent Cross-Site Request Forgery (CSRF) attacks. You should generate a unique value for each authorization request and store it (e.g., in the user's session) to verify later.
@@ -147,7 +147,7 @@ curl -v -X POST "https://api.instantdb.com/platform/oauth/token" \
- **`access_token`**: The token used to authenticate API requests on behalf of the user. It has a limited lifetime (`expires_in`).
- **`refresh_token`**: A long-lived token used to obtain new access tokens when the current one expires. Store this securely, associated with the user.
- **`expires_in`**: The number of seconds until the `access_token` expires.
-- **`scope`**: The actual scopes granted by the user (may be different from requested).
+- **`scope`**: The actual scopes granted by the user (may differ from the requested scopes).
Store the `access_token`, `refresh_token`, and expiration time securely on your backend, associated with the user who authorized your application.
diff --git a/client/www/app/docs/backend/page.md b/client/www/app/docs/backend/page.md
index f2a4b93439..22c4e910da 100644
--- a/client/www/app/docs/backend/page.md
+++ b/client/www/app/docs/backend/page.md
@@ -16,7 +16,7 @@ We currently offer two server-side SDKs:
## Admin SDK
-`@instantdb/admin` is the JavaScript admin SDK for using Instant in a
+`@instantdb/admin` is the JavaScript Admin SDK for using Instant in a
non-browser context. This library is similar to our client SDK with a few
tweaks.
@@ -33,7 +33,7 @@ const db = init({
});
```
-Similar to `@instantdb/react`, you must `init` before doing any queries or
+As with `@instantdb/react`, you must `init` before doing any queries or
writes. Running `init` authenticates you against our admin API. In addition to
providing your `appId`, you can provide your `adminToken`.
@@ -57,7 +57,7 @@ const data = await db.query({ goals: {}, todos: {} });
const { goals, todos } = data;
```
-In react we use `db.useQuery` to enable "live queries", queries that will
+In React we use `db.useQuery` to enable "live queries", queries that will
automatically update when data changes.
In the admin SDK we instead use an async `db.query` function that simply fires a
@@ -70,7 +70,7 @@ const res = await db.transact([db.tx.todos[id()].update({ title: 'Get fit' })]);
console.log('New todo entry made for with tx-id', res['tx-id']);
```
-`db.transact` is an async function that behaves nearly identical to `db.transact`
+`db.transact` is an async function that behaves nearly identically to `db.transact`
from `@instantdb/react`. It returns a `tx-id` on success.
## Subscriptions on the backend
@@ -145,7 +145,7 @@ To learn more about writing schemas, head on over to the [Modeling your data](/d
## Impersonating users
When you use the admin SDK, you can make _any_ query or transaction. As an admin, you bypass permissions.
-But, sometimes you want to make queries on behalf of your users, and would like to respect permissions.
+But sometimes you want to make queries on behalf of your users and would like to respect permissions.
You can do this with the `db.asUser` function.
@@ -184,7 +184,7 @@ const guestDB = db.asUser({
guest: true,
});
-// Queries and transactions will work with respective permissions
+// Queries and transactions will work with the respective permissions
await userDB.query({ todos: {} });
await guestDB.query({ publicData: {} });
```
@@ -227,7 +227,7 @@ const deletedUser = await db.auth.deleteUser({
});
```
-Note, this _only_ deletes the user record and any associated data with cascade on delete. If there's additional data you need to clean up you'll need to do it manually:
+Note that this _only_ deletes the user record and any associated data with cascade on delete. If there's additional data you need to clean up, you'll need to do it manually:
```typescript {% showCopy=true %}
const { goals, todos } = await db.query({
@@ -245,9 +245,9 @@ await db.auth.deleteUser({ id: userId });
## Presence in the Backend
-If you use [rooms & presence](/docs/presence-and-topics), you may want to query for the data currently in a room with the admin API. This can be especially useful if you are sending a notification for example, and want to skip it if the user is already online.
+If you use [rooms & presence](/docs/presence-and-topics), you may want to query for the data currently in a room with the admin API. This can be especially useful if you are sending a notification, for example, and want to skip it if the user is already online.
-To do get room data from the admin API, use `db.rooms.getPresence`:
+To get room data from the admin API, use `db.rooms.getPresence`:
```typescript {% showCopy=true %}
const data = await db.rooms.getPresence('chat', 'room-123');
@@ -387,7 +387,7 @@ function Login() {
## Custom magic codes
-We support a [magic code flow](/docs/auth) out of the box. However, if you'd like to use your own email provider to send the code, you can do this with `db.auth.generateMagicCode` function:
+We support a [magic code flow](/docs/auth) out of the box. However, if you'd like to use your own email provider to send the code, you can do this with the `db.auth.generateMagicCode` function:
```typescript {% showCopy=true %}
app.post('/custom-send-magic-code', async (req, res) => {
@@ -422,7 +422,7 @@ if (created) {
## Authenticated Endpoints
-You can also use the admin SDK to authenticate users in your custom endpoints. This would have two steps:
+You can also use the Admin SDK to authenticate users in your custom endpoints. This would have two steps:
### 1. Frontend: user.refresh_token
@@ -464,7 +464,7 @@ Sometimes you want to get the logged in user in the backend without needing to e
Instant provides a `createInstantRouteHandler` function that generates a web standard endpoint that can be used to sync the refresh token to a cookie that your server can read.
-To use it in NextJS:
+To use it in Next.js:
```typescript {% showCopy=true %}
// src/app/api/instant/route.ts
@@ -475,9 +475,9 @@ export const { POST } = createInstantRouteHandler({
});
```
-The GET and POST functions accept a [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) and return a [Response](https://developer.mozilla.org/en-US/docs/Web/API/Request) so they should be able to be used in any framework.
+The GET and POST functions accept a [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) and return a [Response](https://developer.mozilla.org/en-US/docs/Web/API/Request), so they should be able to be used in any framework.
-Then, provide your mounted api url to the `init` function.
+Then, provide your mounted API URL to the `init` function.
```typescript {% showCopy=true %}
import { init } from '@instantdb/react';
@@ -490,7 +490,7 @@ export const db = init({
});
```
-If using NextJS you can call getUnverifiedUserFromInstantCookie with the app id to retrieve the user in any server component, or route handler.
+If using Next.js, you can call getUnverifiedUserFromInstantCookie with the app ID to retrieve the user in any server component or route handler.
```typescript
import { getUnverifiedUserFromInstantCookie } from "@instantdb/react/nextjs";
diff --git a/client/www/app/docs/cli/page.md b/client/www/app/docs/cli/page.md
index 2a4dfbbb8c..bf60bf6716 100644
--- a/client/www/app/docs/cli/page.md
+++ b/client/www/app/docs/cli/page.md
@@ -15,7 +15,7 @@ To get started, you need to log in to your Instant account. You can do this by r
npx instant-cli@latest login
```
-This will open a browser window where you can authenticate with your Instant account. Once authenticated you'll be able to run commands that interact with your Instant apps!
+This will open a browser window where you can authenticate with your Instant account. Once authenticated, you'll be able to run commands that interact with your Instant apps!
## Logout
@@ -25,7 +25,7 @@ To log out of your Instant account and remove your authentication token from you
npx instant-cli@latest logout
```
-This will clear your stored credentials. You'll need to login again to interact with your Instant apps.
+This will clear your stored credentials. You'll need to log in again to interact with your Instant apps.
## Init
@@ -48,7 +48,7 @@ npx instant-cli@latest init --temp
This will create an ephemeral app that automatically deletes itself after 24 hours. You can later transfer a temporary app to your account with `instant-cli claim`.
-To learn how to change `instant.schema.ts`, check our [Modeling Data](/docs/modeling-data). For `instant.perms.ts`, check out the [permissions](/docs/permissions) page.
+To learn how to change `instant.schema.ts`, check out our [Modeling Data](/docs/modeling-data). For `instant.perms.ts`, check out the [permissions](/docs/permissions) page.
## Push
@@ -135,7 +135,7 @@ The results match what your client queries return, including cardinality. If you
## App ID
-Whenever you run a CLI command, we look up your app id. You can either provide an app id as an option:
+Whenever you run a CLI command, we look up your app ID. You can either provide an app ID as an option:
```shell
npx instant-cli@latest init --app $MY_APP_ID
@@ -157,7 +157,7 @@ As a convenience, apart from `INSTANT_APP_ID`, we also check for:
## Where to save files
-By default, Instant will search for your `instant.schema.ts` and `instant.perms.ts` file in:
+By default, Instant will search for your `instant.schema.ts` and `instant.perms.ts` files in:
1. The `root` directory: `./`
2. The `src` directory: `./src`
@@ -178,7 +178,7 @@ INSTANT_PERMS_FILE_PATH=./src/db/instant.perms.ts
In CI or similar environments, you may want to handle authentication without having to go through a web-based validation step each time.
-In these cases, you can provide a `INSTANT_CLI_AUTH_TOKEN` environment variable.
+In these cases, you can provide an `INSTANT_CLI_AUTH_TOKEN` environment variable.
To obtain a token for later use, run:
@@ -196,7 +196,7 @@ Sometimes you want to create an Instant app without generating `instant.schema.t
npx instant-cli@latest init-without-files --title "Hello World"
```
-The app's id and admin token are outputted to stdout as JSON:
+The app's ID and admin token are outputted to stdout as JSON:
```shell
{
@@ -208,7 +208,7 @@ The app's id and admin token are outputted to stdout as JSON:
}
```
-You can also make ephemeral apps that will clean up themselves after >24 hours
+You can also make ephemeral apps that will clean themselves up after more than 24 hours
via the `--temp` flag:
```shell {% showCopy=true %}
@@ -286,7 +286,7 @@ const email = {
Copy and paste this into the confirmation box, and you'll be on your way.
- Note: This code will expire in {expiration}, and can only be used once. If
+ Note: This code will expire in {expiration} and can only be used once. If
you didn't request this code, please reply to this email.
diff --git a/client/www/app/docs/common-mistakes/page.md b/client/www/app/docs/common-mistakes/page.md
index b912d9c3cb..f6cea14c98 100644
--- a/client/www/app/docs/common-mistakes/page.md
+++ b/client/www/app/docs/common-mistakes/page.md
@@ -47,7 +47,7 @@ const _schema = i.schema({
## Common mistakes with permissions
-Sometimes you want to express permissions based on an attribute in a linked entity. For those instances you can use `data.ref`.
+Sometimes you want to express permissions based on an attribute in a linked entity. For those instances, you can use `data.ref`.
❌ **Common mistake**: Not using `data.ref` to reference linked data
@@ -73,7 +73,7 @@ Sometimes you want to express permissions based on an attribute in a linked enti
}
```
-When using `data.ref` the last part of the string is the attribute you want to access. If you do not specify an attribute an error will occur.
+When using `data.ref`, the last part of the string is the attribute you want to access. If you do not specify an attribute, an error will occur.
❌ **Common mistake**: Not specifying an attribute when using data.ref
@@ -143,7 +143,7 @@ Be careful when checking whether there are no linked entities. Here are a few co
"view": "data.ref('owner.id') != []"
```
-Use `auth.ref` to reference the authenticated user's linked data. This behaves similar to `data.ref` but you _MUST_ use the `$user` prefix when referencing auth data:
+Use `auth.ref` to reference the authenticated user's linked data. This behaves similarly to `data.ref`, but you _MUST_ use the `$user` prefix when referencing auth data:
❌ **Common mistake**: Missing `$user` prefix with `auth.ref`
@@ -357,7 +357,7 @@ const query = { goals: {}, todos: {} };
const query = { goals: { todos: {} } };
```
-Use `where` operator to filter entities:
+Use the `where` operator to filter entities:
❌ **Common mistake**: Placing `where` at the wrong level
@@ -385,7 +385,7 @@ const query = {
};
```
-`where` operators support filtering entities based on associated values
+`where` operators support filtering entities based on associated values.
❌ **Common mistake**: Incorrect syntax for filtering on associated values
@@ -522,7 +522,7 @@ const query = {
};
```
-Use the `order` operator to sort results
+Use the `order` operator to sort results.
❌ **Common mistake**: Using `orderBy` instead of `order`
@@ -571,7 +571,7 @@ const query = {
## Common mistakes with Instant on the backend
-Use `db.query` in the admin SDK instead of `db.useQuery`. It is an async API without loading states. We wrap queries in try catch blocks to handle errors. Unlike the client SDK, queries in the admin SDK bypass permission checks
+Use `db.query` in the Admin SDK instead of `db.useQuery`. It is an async API without loading states. We wrap queries in try-catch blocks to handle errors. Unlike the client SDK, queries in the Admin SDK bypass permission checks.
❌ **Common mistake**: Using `db.useQuery` in the admin SDK
@@ -603,7 +603,7 @@ InstantDB does not provide built-in username/password authentication.
❌ **Common mistake**: Using password-based authentication in client-side code
-✅ **Correction**: Use Instant's magic code or OAuth flows instead in client-side code
+✅ **Correction**: Use Instant's magic code or OAuth flows in client-side code instead
If you need traditional password-based authentication, you must implement it as a custom auth flow using the Admin SDK.
diff --git a/client/www/app/docs/create-instant-app/page.md b/client/www/app/docs/create-instant-app/page.md
index ad1fff5c36..9b64fdb6c0 100644
--- a/client/www/app/docs/create-instant-app/page.md
+++ b/client/www/app/docs/create-instant-app/page.md
@@ -9,7 +9,7 @@ Once you know the basics of Instant, you may find it useful to be able to
quickly scaffold a new Instant project. We built `create-instant-app` to do just
that.
-We currently offer templates for Next.js, Vite + React, Expo, and Vanilla Typescript. Follow the quick start below to give it a spin!
+We currently offer templates for Next.js, Vite + React, Expo, and Vanilla TypeScript. Follow the quick start below to give it a spin!
## Quick start
@@ -24,7 +24,7 @@ This will open a browser window where you can log in or sign up for an account.
Once you've authenticated, any app you create with `create-instant-app` will be
associated with your Instant account!
-After authenticating you run the following command to scaffold a new Instant app.
+After authenticating, run the following command to scaffold a new Instant app.
```shell {% showCopy=true %}
npx create-instant-app instant-demo
diff --git a/client/www/app/docs/devtool/page.md b/client/www/app/docs/devtool/page.md
index 7600a98c5e..0a3df1bc15 100644
--- a/client/www/app/docs/devtool/page.md
+++ b/client/www/app/docs/devtool/page.md
@@ -5,7 +5,7 @@ nextjs:
description: 'Use the Instant devtool to inspect your app in development.'
---
-When you load your app in development, you'll notice a little "Instant" Icon show up:
+When you load your app in development, you'll notice a little "Instant" icon show up:
{% screenshot src="/img/docs/devtool-pointer.jpg" /%}
@@ -37,7 +37,7 @@ const db = init({
});
```
-You can set `bottom-left`, `top-left`, `top-right`, `bottom-right`.
+You can set it to `bottom-left`, `top-left`, `top-right`, or `bottom-right`.
## Custom Hosts
@@ -79,4 +79,4 @@ To quickly toggle the window, you can use the shortcut `ctrl` + `shift` + `0` (z
## Feedback?
-If you have any feedback, let us know on [Discord](https://discord.com/invite/VU53p7uQcE)
+If you have any feedback, let us know on [Discord](https://discord.com/invite/VU53p7uQcE).
diff --git a/client/www/app/docs/emails/page.md b/client/www/app/docs/emails/page.md
index 31169cbcea..669517661e 100644
--- a/client/www/app/docs/emails/page.md
+++ b/client/www/app/docs/emails/page.md
@@ -29,8 +29,8 @@ Using a variable is as easy as adding the variable's name in curly brackets, e.g
## Custom sender addresses
-You can also set Instant's email's `from` and `reply-to` fields to an address on your own domain.
+You can also set the `from` and `reply-to` fields on Instant's emails to an address on your own domain.
If you provide a custom sender address, you'll need to confirm it before we can start delivering from it.
-Our email partner, Postmark, will send a confirmation to the provided address with a link to verify. Until the address is verified, emails will continue to be sent from Instant's default auth sender (`auth@pm.instantdb.com`).
+Our email partner, Postmark, will send a confirmation to the provided address with a link to verify it. Until the address is verified, emails will continue to be sent from Instant's default auth sender (`auth@pm.instantdb.com`).
diff --git a/client/www/app/docs/explorer-component/page.md b/client/www/app/docs/explorer-component/page.md
index d23465bff0..5db6680909 100644
--- a/client/www/app/docs/explorer-component/page.md
+++ b/client/www/app/docs/explorer-component/page.md
@@ -5,7 +5,7 @@ nextjs:
description: 'Use the Explorer Component in your own apps'
---
-The explorer page from the Instant Dashboard is available as an installable React component that you can use in your own apps. This is especially useful if you're building **a platform or app builder** powered by Instant
+The explorer page from the Instant Dashboard is available as an installable React component that you can use in your own apps. This is especially useful if you're building **a platform or app builder** powered by Instant.
```tsx
import './App.css';
diff --git a/client/www/app/docs/http-api/page.md b/client/www/app/docs/http-api/page.md
index faeb1243a6..653d68bbab 100644
--- a/client/www/app/docs/http-api/page.md
+++ b/client/www/app/docs/http-api/page.md
@@ -5,21 +5,21 @@ nextjs:
description: "Direct HTTP access to Instant's admin API for non-JavaScript environments."
---
-If your backend is written in Javascript, you can use the [`@instantdb/admin`](/docs/backend) SDK to connect your server to Instant.
+If your backend is written in JavaScript, you can use the [`@instantdb/admin`](/docs/backend) SDK to connect your server to Instant.
-But what if your backend isn't written in Javascript? That's where the HTTP API comes in.
+But what if your backend isn't written in JavaScript? That's where the HTTP API comes in.
You can use the HTTP API in your favorite backend language to run scripts, create custom auth flows, or evaluate sensitive app logic.
{% callout type="note" %}
-If you give this documentation to your AI agent, it can create a custom SDK for your backend language. Here's the [markdown](/docs/http-api.md).
+If you give this documentation to your AI agent, it can create a custom SDK for your backend language. Here's the [Markdown](/docs/http-api.md).
{% /callout %}
## Auth
-First and foremost, grab your app's `APP_ID` and `ADMIN_TOKEN`. You can get this by going to your
+First and foremost, grab your app's `APP_ID` and `ADMIN_TOKEN`. You can get them by going to your
[dashboard](https://instantdb.com/dash). To authenticate requests, include them in your HTTP headers:
```shell {% lineHighlight="3,4" %}
@@ -212,7 +212,7 @@ curl -X DELETE "https://api.instantdb.com/admin/users?refresh_token=$REFRESH_TOK
## Presence in the Backend
-If you use [rooms & presence](/docs/presence-and-topics), you may want to query for the data currently in a room. This can be especially useful if you are sending a notification for example, and want to skip it if the user is already online. To do get room data use `GET /admin/rooms/presence`. Make sure to pass in a `room-type` and a `room-id`:
+If you use [rooms & presence](/docs/presence-and-topics), you may want to query for the data currently in a room. This can be especially useful if you are sending a notification, for example, and want to skip it if the user is already online. To get room data, use `GET /admin/rooms/presence`. Make sure to pass in a `room-type` and a `room-id`:
```shell
curl -X GET "https://api.instantdb.com/admin/rooms/presence?room-type=chat&room-id=room-123" \
@@ -222,7 +222,7 @@ curl -X GET "https://api.instantdb.com/admin/rooms/presence?room-type=chat&room-
## Sign Out
-`POST /admin/sign_out` allows you to log out users. You can log out a user out from every session by passing in their `email` or `id`. Or you can log a user out from a particular session by passing in a `refresh_token`:
+`POST /admin/sign_out` allows you to log out users. You can log a user out from every session by passing in their `email` or `id`. Or you can log a user out from a particular session by passing in a `refresh_token`:
```shell {% lineHighlight="6,13,20" %}
# All sessions for this email sign out
@@ -270,7 +270,7 @@ curl -X POST "https://api.instantdb.com/admin/refresh_tokens" \
```
If a user with the given `id` or `email` does not exist, Instant will create the
-user for you. You can pass `extra-fields` to set custom `$users` properties on creation. The response includes `user.refresh_token` and `"created": true` when a new user is created. You can pass this token onto your client, and use that to [log in](/docs/backend#2-frontend-db-auth-sign-in-with-token)
+user for you. You can pass `extra-fields` to set custom `$users` properties on creation. The response includes `user.refresh_token` and `"created": true` when a new user is created. You can pass this token on to your client and use it to [log in](/docs/backend#2-frontend-db-auth-sign-in-with-token).
## Custom magic codes
diff --git a/client/www/app/docs/infinite-queries/page.md b/client/www/app/docs/infinite-queries/page.md
index a77bbf6c63..fabca80aa5 100644
--- a/client/www/app/docs/infinite-queries/page.md
+++ b/client/www/app/docs/infinite-queries/page.md
@@ -7,7 +7,7 @@ nextjs:
It is a common pattern to show users a long list of items that gets larger as they interact. Instant supports this pattern with the `useInfiniteQuery` hook.
-The useInfiniteQuery hook is designed to work just like the useQuery hook. You make the same kind of queries and it returns the same kind of data. But now you get a canLoadNextPage variable, and a loadNextPage function to load more items.
+The useInfiniteQuery hook is designed to work just like the useQuery hook. You make the same kind of queries, and it returns the same kind of data. But now you get a canLoadNextPage variable and a loadNextPage function to load more items.
## Example
@@ -51,11 +51,11 @@ function HomePage() {
}
```
-Any new posts that get created will automatically appear at the top, and as the user scrolls, the `loadNextPage` can load older posts as needed.
+Any new posts that get created will automatically appear at the top, and as the user scrolls, the `loadNextPage` function can load older posts as needed.
## Reactivity
-Just like `useQuery`, all data returned is fully reactive. Updating and deleting items will react immediately. New items added to the "start" of the query will show up automatically as well as items anywhere in the middle. Items that _would_ be ordered at the very end of the results will show up if the limit for that page has not yet been reached.
+Just like `useQuery`, all data returned is fully reactive. Updates and deletions will appear immediately. New items added to the "start" of the query will show up automatically, as will items added anywhere in the middle. Items that _would_ be ordered at the very end of the results will show up if the limit for that page has not yet been reached.
For example, with `{todos: {$: {limit: 20, order: createdAt: "asc"}}}` (showing oldest todos first)
diff --git a/client/www/app/docs/init/page.md b/client/www/app/docs/init/page.md
index 6f71aec362..65e2657947 100644
--- a/client/www/app/docs/init/page.md
+++ b/client/www/app/docs/init/page.md
@@ -27,7 +27,7 @@ With that, you can use `db` to [write data](/docs/instaml), [make queries](/docs
## Typesafety
-If you're using typescript, `init` accepts a `schema` argument. Adding a schema provides auto-completion and typesafety for your queries and transactions.
+If you're using TypeScript, `init` accepts a `schema` argument. Adding a schema provides auto-completion and typesafety for your queries and transactions.
```typescript
import { init, i } from '@instantdb/react';
@@ -62,7 +62,7 @@ To learn more about writing schemas, head on over to the [Modeling your data](/d
Instant maintains a single connection regardless of where or how many times you
call `init` with the same app ID. This means you can safely call `init` multiple
times without worrying about creating multiple connections or
-performance overhead. However we do recommend the pattern of exporting a
+performance overhead. However, we do recommend the pattern of exporting a
reference from a utility file like so:
@@ -110,4 +110,4 @@ and `schema`. Here are all the options you can provide:
- **queryCacheLimit?**: Maximum number of query subscriptions to cache for offline mode. Defaults to `10`. Cached queries provide instant data on app reload while fresh data loads in the background.
-- **useDateObjects?**: When `true`, all date columns in queries will return a Javascript `Date` object. Disabled by default.
+- **useDateObjects?**: When `true`, all date columns in queries will return a JavaScript `Date` object. Disabled by default.
diff --git a/client/www/app/docs/instaml/page.md b/client/www/app/docs/instaml/page.md
index 435b547e4b..8eda165d79 100644
--- a/client/www/app/docs/instaml/page.md
+++ b/client/www/app/docs/instaml/page.md
@@ -5,7 +5,7 @@ nextjs:
description: 'How to write data with Instant using InstaML.'
---
-Instant uses a **Firebase-inspired** interface for mutations. We call our mutation language **InstaML**
+Instant uses a **Firebase-inspired** interface for mutations. We call our mutation language **InstaML**.
## Creating data
@@ -39,7 +39,7 @@ db.transact(
## Update data
-The `update` action is used for updating entities. Suppose we had created the following goal
+The `update` action is used for updating entities. Suppose we had created the following goal:
```javascript
const eatId = id();
@@ -56,7 +56,7 @@ db.transact(db.tx.goals[eatId].update({ lastTimeEaten: 'Today' }));
This will only update the value of the `lastTimeEaten` attribute for entity `eat`.
-Similar to NoSQL, you don't need to use the same schema for each entity in a namespace. After creating the previous goal you can run the following:
+As with NoSQL, you don't need to use the same schema for each entity in a namespace. After creating the previous goal, you can run the following:
```javascript
db.transact(
@@ -70,9 +70,9 @@ db.transact(
);
```
-`update` function works as create or update depending on whether the entity already exists or not (so called "upsert" mode). If entity doesn’t exist yet, calling `update` will create it, otherwise it will update.
+The `update` function creates or updates an entity depending on whether it already exists (so-called "upsert" mode). If the entity doesn’t exist yet, calling `update` will create it; otherwise, it will update it.
-To force “strict update” mode, pass `{ upsert: false }` option:
+To force “strict update” mode, pass the `{ upsert: false }` option:
```javascript
db.transact(
@@ -84,12 +84,12 @@ db.transact(
When you `update` an attribute, you overwrite it. This is fine for updating
values of strings, numbers, and booleans. But if you use `update` to overwrite
-json objects you may encounter two problems:
+JSON objects, you may encounter two problems:
1. You lose any data you didn't specify.
-2. You risk clobbering over changes made by other clients.
+2. You risk clobbering changes made by other clients.
-For example, imagine we had a `game` entity, that stored a `state` of favorite colors:
+For example, imagine we had a `game` entity that stored a `state` of favorite colors:
```javascript
// User 1 saves {'0-0': 'red'}
@@ -98,11 +98,11 @@ db.transact(db.tx.games[gameId].update({ state: { '0-0': 'red' } }));
// User 2 saves {'0-1': 'blue'}
db.transact(db.tx.games[gameId].update({ state: { '0-1': 'blue' } }));
-// 🤔 Uh oh! User 2 overwrite User 1:
+// 🤔 Uh oh! User 2 overwrites User 1's changes:
// Final State: {'0-1': 'blue' }
```
-To make working with deeply-nested, document-style JSON values a breeze, we created `merge`.
+To make working with deeply nested, document-style JSON values a breeze, we created `merge`.
Similar to [lodash's `merge` function](https://lodash.com/docs/4.17.15#merge),
`merge` allows you to specify the slice of data you want to update:
@@ -139,7 +139,7 @@ The `delete` action is used for deleting entities.
db.transact(db.tx.goals[eatId].delete());
```
-You can generate an array of `delete` txs to delete all entities in a namespace
+You can generate an array of `delete` txs to delete all entities in a namespace:
```javascript
const { isLoading, error, data } = db.useQuery({ goals: {} });
@@ -194,13 +194,13 @@ db.transact([
]);
```
-Links are bi-directional. Say we link `healthId` to `workoutId`
+Links are bi-directional. Say we link `healthId` to `workoutId`:
```javascript
db.transact(db.tx.goals[healthId].link({ todos: workoutId }));
```
-We can query associations in both directions
+We can query associations in both directions:
```javascript
const { isLoading, error, data } = db.useQuery({
@@ -215,7 +215,7 @@ console.log('todos with nested goals', todos);
## Unlink data
-Links can be removed via `unlink.`
+Links can be removed via `unlink`.
```javascript
db.transact(db.tx.goals[healthId].unlink({ todos: workoutId }));
@@ -298,7 +298,7 @@ const _schema = i.schema({
// ...
```
-Instant will enforce that `todos.dueDate` are actually dates, and you'll get some nice intellisense to boot:
+Instant will enforce that `todos.dueDate` values are actually dates, and you'll get some nice IntelliSense to boot:
{% screenshot src="/img/docs/instaml-due-date.png" /%}
@@ -325,7 +325,7 @@ function myCustomUpdate(
}
```
-And the `LinkParams` utility do the same for links:
+And the `LinkParams` utility can do the same for links:
```typescript
import { LinkParams } from '@instantdb/react';
@@ -346,7 +346,7 @@ To learn more about writing schemas, check out the [Modeling Data](/docs/modelin
## Batching transactions
If you have a large number of transactions to commit, you'll want to batch them
-to avoid hitting transaction limits and time outs.
+to avoid hitting transaction limits and timeouts.
Suppose we want to create 3000 goals. Here's how we can batch them into 30 transactions of 100 goals each.
@@ -384,7 +384,7 @@ const createGoals = async (total) => {
## Using the tx proxy object
-`db.tx` is a [proxy object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) which creates transaction chunks to be committed via `db.transact`. It follows the format
+`db.tx` is a [proxy object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) which creates transaction chunks to be committed via `db.transact`. It follows the format:
```
db.tx.NAMESPACE_LABEL[ENTITY_IDENTIFIER].ACTION(ACTION_SPECIFIC_DATA)
@@ -396,5 +396,5 @@ db.tx.NAMESPACE_LABEL[ENTITY_IDENTIFIER].ACTION(ACTION_SPECIFIC_DATA)
- `ACTION_SPECIFIC_DATA` depends on the action
- `create` and `update` take in an object of information to commit
- `merge` takes in an object to deep merge with the existing data
- - `delete` is the only action that doesn't take in any data,
- - `link` and `unlink` takes an object of label-entity pairs to create/delete associations
+ - `delete` is the only action that doesn't take in any data
+ - `link` and `unlink` take an object of label-entity pairs to create/delete associations
diff --git a/client/www/app/docs/instaql/page.md b/client/www/app/docs/instaql/page.md
index 3b4344a958..73226c3c7a 100644
--- a/client/www/app/docs/instaql/page.md
+++ b/client/www/app/docs/instaql/page.md
@@ -184,7 +184,7 @@ const data = {goals: _goals.map(g => (
))
```
-Now compare these two approaches with `InstaQL`
+Now compare these two approaches with `InstaQL`:
```javascript
const query = {
@@ -195,13 +195,13 @@ const query = {
const { isLoading, error, data } = db.useQuery(query);
```
-Modern applications often need to render nested relations, `InstaQL` really starts to shine for these use cases.
+Modern applications often need to render nested relations. `InstaQL` really starts to shine for these use cases.
## Fetch specific associations
### A) Fetch associations for filtered namespace
-We can fetch a specific entity in a namespace as well as it's related associations.
+We can fetch a specific entity in a namespace as well as its related associations.
```javascript
const query = {
@@ -217,7 +217,7 @@ const query = {
const { isLoading, error, data } = db.useQuery(query);
```
-Which returns
+This returns:
```javascript
console.log(data)
@@ -247,7 +247,7 @@ console.log(data)
### B) Filter namespace by associated values
-We can filter namespaces **by their associations**
+We can filter namespaces **by their associations**:
```javascript
const query = {
@@ -263,7 +263,7 @@ const query = {
const { isLoading, error, data } = db.useQuery(query);
```
-Returns
+This returns:
```javascript
console.log(data)
@@ -310,7 +310,7 @@ const query = {
const { isLoading, error, data } = db.useQuery(query);
```
-This will return goals and filtered todos
+This will return goals and filtered todos:
```javascript
console.log(data)
@@ -414,7 +414,7 @@ const {
## Pagination
-You can limit the number of items from a top level namespace by adding a `limit` to the option map:
+You can limit the number of items from a top-level namespace by adding a `limit` to the option map:
```javascript
const query = {
@@ -671,7 +671,7 @@ console.log(data)
The `where` clause supports `and` queries which are useful when you want to filter entities that match multiple associated values.
-In this example we want to find goals that have todos with the titles `Drink protein` and `Go on a run`
+In this example, we want to find goals that have todos with the titles `Drink protein` and `Go on a run`:
```javascript
const query = {
@@ -981,9 +981,9 @@ console.log(data)
The `where` clause supports `$like` on fields that are indexed with a checked `string` type.
-`$like` queries will return entities that match a **case sensitive** substring of the provided value for the field.
+`$like` queries will return entities that match a **case-sensitive** substring of the provided value for the field.
-For **case insensitive** matching use `$ilike` in place of `$like`.
+For **case-insensitive** matching, use `$ilike` in place of `$like`.
Here's how you can do queries like `startsWith`, `endsWith` and `includes`.
@@ -1022,7 +1022,7 @@ console.log(data)
}
```
-You can use `$like` in nested queries as well
+You can use `$like` in nested queries as well:
```javascript
// Find goals that have todos with the word "standup" in their title
@@ -1038,7 +1038,7 @@ const query = {
const { isLoading, error, data } = db.useQuery(query);
```
-Returns
+This returns:
```javascript
console.log(data)
@@ -1160,7 +1160,7 @@ selected fields.
{% callout type="warning" %}
Using `fields` doesn't restrict a client from doing a full query. If you have sensitive data on your entities that you
-don't want to expose you'll want to use [permissions](/docs/permissions#fields) to restrict access.
+don't want to expose, you'll want to use [permissions](/docs/permissions#fields) to restrict access.
{% /callout %}
@@ -1205,7 +1205,7 @@ const _schema = i.schema({
},
});
-// This helps TypeScript display better intellisense
+// This helps TypeScript display better IntelliSense
type _AppSchema = typeof _schema;
interface AppSchema extends _AppSchema {}
const schema: AppSchema = _schema;
@@ -1214,7 +1214,7 @@ export type { AppSchema };
export default schema;
```
-Instant will start giving you intellisense for your queries. For example, if you're querying for goals, you'll see that only `todos` can be associated:
+Instant will start giving you IntelliSense for your queries. For example, if you're querying for goals, you'll see that only `todos` can be associated:
{% screenshot src="/img/docs/instaql-todos-goals-autocomplete.png" /%}
@@ -1266,7 +1266,7 @@ To learn more about writing schemas, check out the [Modeling Data](/docs/modelin
## Query once
-Sometimes, you don't want a subscription, and just want to fetch data once. For example, you might want to fetch data before rendering a page or check whether a user name is available.
+Sometimes, you don't want a subscription and just want to fetch data once. For example, you might want to fetch data before rendering a page or check whether a username is available.
In these cases, you can use `queryOnce` instead of `useQuery`. `queryOnce` returns a promise that resolves with the data once the query is complete.
diff --git a/client/www/app/docs/migrate-from-supabase/page.md b/client/www/app/docs/migrate-from-supabase/page.md
index 36541caff5..3cef85b3bb 100644
--- a/client/www/app/docs/migrate-from-supabase/page.md
+++ b/client/www/app/docs/migrate-from-supabase/page.md
@@ -23,7 +23,7 @@ Ask the user for source and target directories.
## Process
1. **Setup**: Run `npx instant-cli info` to check login. If not logged in,
- direct user to https://instantdb.com then `npx instant-cli login`.
+ direct the user to https://instantdb.com then `npx instant-cli login`.
Create app: `npx instant-cli init-without-files --title ""`
2. **Copy project**: Copy source to target (excluding `node_modules`, `.next`).
@@ -45,7 +45,7 @@ Ask the user for source and target directories.
6. **Migrate data**: Ask the user if they have data to migrate. If yes, ask for
their Supabase service role key. Write and run export + import scripts.
- If app uses Supabase Storage, migrate files too.
+ If the app uses Supabase Storage, migrate files too.
7. **Verify**: Build must pass. Test all pages and auth flows.
diff --git a/client/www/app/docs/modeling-data/page.md b/client/www/app/docs/modeling-data/page.md
index 7c70580cff..fe466ef746 100644
--- a/client/www/app/docs/modeling-data/page.md
+++ b/client/www/app/docs/modeling-data/page.md
@@ -16,7 +16,7 @@ We’ll build a micro-blog to illustrate; we'll have authors, posts, comments, a
## Schema as Code
-With Instant you can define your schema and your permissions in code. If you haven't already, use the [CLI](/docs/cli) to generate an `instant.schema.ts`, and a `instant.perms.ts` file:
+With Instant you can define your schema and your permissions in code. If you haven't already, use the [CLI](/docs/cli) to generate an `instant.schema.ts` and an `instant.perms.ts` file:
```shell {% showCopy=true %}
npx instant-cli@latest init
@@ -81,7 +81,7 @@ const _schema = i.schema({
},
});
-// This helps TypeScript display better intellisense
+// This helps TypeScript display better IntelliSense
type _AppSchema = typeof _schema;
interface AppSchema extends _AppSchema {}
const schema: AppSchema = _schema;
@@ -112,7 +112,7 @@ const _schema = i.schema({
## 2) Attributes
-Attributes are properties associated with namespaces. These are equivalent to a "column" in relational databases or a "field" in NoSQL. For the `posts` entity, we have the `title`, `body`, and `createdAt` attributes:
+Attributes are properties associated with namespaces. Each is equivalent to a "column" in relational databases or a "field" in NoSQL. For the `posts` entity, we have the `title`, `body`, and `createdAt` attributes:
```typescript
// instant.schema.ts
@@ -155,7 +155,7 @@ const _schema = i.schema({
});
```
-Instant will _make sure_ that all `title` attributes are strings, and you'll get the proper typescript hints to boot!
+Instant will _make sure_ that all `title` attributes are strings, and you'll get the proper TypeScript hints to boot!
### Required constraints
@@ -208,7 +208,7 @@ postAuthor: {
},
```
-Finally, for legacy attributes that are treated as required on your front-end but you are not ready to enable back-end required checks yet, you can use `.clientRequired()`. That will produce TypeScript type without `null` but will not add back-end required check:
+Finally, for legacy attributes that are treated as required on your front-end but you are not ready to enable back-end required checks yet, you can use `.clientRequired()`. That will produce a TypeScript type without `null` but will not add a back-end required check:
```typescript
const _schema = i.schema({
@@ -223,7 +223,7 @@ const _schema = i.schema({
### Unique constraints
-Sometimes you'll want to introduce a unique constraint. For example, say we wanted to add friendly URL's to posts. We could introduce a `slug` attribute:
+Sometimes you'll want to introduce a unique constraint. For example, say we wanted to add friendly URLs to posts. We could introduce a `slug` attribute:
```typescript
// instant.schema.ts
@@ -335,7 +335,7 @@ const query2 = {
};
```
-Links can have one of four relationship types: `many-to-many`, `many-to-one`, `one-to-many`, and `one-to-one`
+Links can have one of four relationship types: `many-to-many`, `many-to-one`, `one-to-many`, and `one-to-one`.
Our micro-blog example has the following relationship types:
@@ -361,7 +361,7 @@ db.tx.profiles[user_id].delete();
Without `onDelete: "cascade"`, deleting a profile would simply delete the links but not delete the underlying posts.
-If you prefer to model links in other direction, you can do it, too:
+If you prefer to model links in the other direction, you can do it, too:
```
postAuthor: {
diff --git a/client/www/app/docs/next-ssr/page.md b/client/www/app/docs/next-ssr/page.md
index 2425e6d041..f163e194d6 100644
--- a/client/www/app/docs/next-ssr/page.md
+++ b/client/www/app/docs/next-ssr/page.md
@@ -1,11 +1,11 @@
---
nextjs:
metadata:
- title: '(Experimental) NextJS SSR'
- description: 'Use server-side-rendering with InstantDB and Next.js.'
+ title: '(Experimental) Next.js SSR'
+ description: 'Use server-side rendering with InstantDB and Next.js.'
---
-If you use NextJS and want to do server-side rendering, we have an experimental library for you.
+If you use Next.js and want to do server-side rendering, we have an experimental library for you.
`@instantdb/react/nextjs` can let you run Instant queries both on the server and the client, and for the first time, _share caches between them_. (If you don’t get what this means yet, no worries, we’ll explain in detail in the document! Suffice it to say it’s pretty cool.)
@@ -20,29 +20,29 @@ In this essay we’ll cover:
## What is server-side rendering?
-Server-side rendering lets you run your Javascript code in two environments.
+Server-side rendering lets you run your JavaScript code in two environments.
-First the server renders your React component. So as soon as a browser sees your website, your React component is there.
+First, the server renders your React component. So as soon as a browser sees your website, your React component is there.
-Once the browser loads Javascript, the same component runs on the client once more. This way if you have hover effects or other logic that needs to attach to your component, it can do that in the browser.
+Once the browser loads JavaScript, the same component runs on the client once more. This way, if you have hover effects or other logic that needs to attach to your component, it can do that in the browser.
To get a sense for how this all works, imagine loading a todo app:

-Without SSR, when you first load the site you’d see a blank page. Once Javascript gets loaded, React would kick in and you’d see your todos show up.
+Without SSR, when you first loaded the site, you’d see a blank page. Once JavaScript loaded, React would kick in and you’d see your todos show up.
-With SSR, your todo component would render on the server first. The _very_ first load in the browser would already show todos. Once Javascript loads, the todo component would re-attach and all the click handlers and effects would work.
+With SSR, your todo component would render on the server first. The _very_ first load in the browser would already show todos. Once JavaScript loaded, the todo component would reattach and all the click handlers and effects would work.
## When is server-side rendering a good idea?
-On first glance, server-side rendering can sound great. Why not run your code right away on the server? Well, there are two costs:
+At first glance, server-side rendering can sound great. Why not run your code right away on the server? Well, there are two costs:
### The costs
-**The biggest cost is complexity**: Your code runs in two environments. Once on the server, and once on the client. NextJS and Instant can do a good job of hiding the difference, but sometimes those differences leak out (as a basic example, there’s no `window` in the server). For many applications, you may not want the added complexity.
+**The biggest cost is complexity**: Your code runs in two environments. Once on the server, and once on the client. Next.js and Instant can do a good job of hiding the difference, but sometimes those differences leak out (as a basic example, there’s no `window` on the server). For many applications, you may not want the added complexity.
-**The second cost relates to client-heavy applications:** If you want your application to _feel_ like a desktop app, you’ll want to reduce the amount of times your application pauses while navigating. This means that you have to be proactive with fallback states when using ``, or prefetch anticipated queries more agressively.
+**The second cost relates to client-heavy applications:** If you want your application to _feel_ like a desktop app, you’ll want to reduce the number of times your application pauses while navigating. This means that you have to be proactive with fallback states when using ``, or prefetch anticipated queries more aggressively.
{% callout type="note" %}
@@ -54,9 +54,9 @@ Tip: You can prefetch queries by `db.queryOnce()` from anywhere, or by using `db
But there are also some clear benefits.
-**SSR can be great for search engines.** Web crawlers are getting better with Javascript, but they generally do the best job at indexing websites when the content is there on the first load. SSR can do this for you.
+**SSR can be great for search engines.** Web crawlers are getting better with JavaScript, but they generally do the best job at indexing websites when the content is there on the first load. SSR can do this for you.
-**SSR can remove loading screens, especially if you use NextJS Routes.** Sometimes you load an app and see _lots_ of loading spinners. SSR can help you remove those spinners. Since there’s content on the first load, you can often ignore loading states completely. You may wonder, won’t the first load be slower if you’re fetching data? Not by much, for two reasons. First If you use NextJS routing, it will try to pre-fetch as much as possible. By the time a user clicks a link, the data is often already there. Second, if you use Vercel, their servers are close to Instant servers, which means queries often take milliseconds to transfer.
+**SSR can remove loading screens, especially if you use Next.js Routes.** Sometimes you load an app and see _lots_ of loading spinners. SSR can help you remove those spinners. Since there’s content on the first load, you can often ignore loading states completely. You may wonder, won’t the first load be slower if you’re fetching data? Not by much, for two reasons. First, if you use Next.js routing, it will try to pre-fetch as much as possible. By the time a user clicks a link, the data is often already there. Second, if you use Vercel, their servers are close to Instant servers, which means queries often take milliseconds to transfer.
Put these benefits together, and sometimes SSR really is worth it.
@@ -68,25 +68,25 @@ With `@instantdb/react/nextjs` you get a special package with a new hook: `db.us

-When you use `db.useSuspenseQuery`. (1) On the server it will run a query once and get data. When loaded in the browser, (2) it will re-connect and subscribe to changes on the same query. **This means on the first load you have data, _and_ it becomes real-time in the browser.**
+When you use `db.useSuspenseQuery`, (1) it will run a query once and get data on the server. When loaded in the browser, (2) it will reconnect and subscribe to changes on the same query. **This means on the first load you have data, _and_ it becomes real-time in the browser.**
### What about offline caches?
There's nothing faster than local data. If `useSuspenseQuery` is running on the client, it will use the local data and websocket connection instead.
-In addition, when the page first loads from SSR, it will update the local cache with the most up to date results.
+In addition, when the page first loads from SSR, it will update the local cache with the most up-to-date results.
{% callout type="warning" %}
-Using SSR can make data fetching slower in one specific case: If you are using a `useSuspenseQuery` and there is not a `` anywhere higher in the component tree, the server will not send any HTML/JS at all until the query has resolved and the page has rendered. In some cases, this is desirable for things like SEO, but if the user already has the query result in their local cache, the page load is blocked, and they won't get a chance to load it and will have to wait.
+Using SSR can make data fetching slower in one specific case: If you are using `useSuspenseQuery` and there is not a `` anywhere higher in the component tree, the server will not send any HTML/JS at all until the query has resolved and the page has rendered. In some cases, this is desirable for things like SEO, but if the user already has the query result in their local cache, the page load is blocked, and they won't get a chance to load it and will have to wait.
-If the component that calls `useSuspenseQuery` is wrapped in a ``, Then the data will be fetched at the same time in both the client and server and the user will see the result from whatever loaded fastest. For returning users, this usually ends up being the local data, but for non-cached queries, the server is often faster.
+If the component that calls `useSuspenseQuery` is wrapped in a ``, then the data will be fetched at the same time on both the client and server, and the user will see whichever result loads fastest. For returning users, this usually ends up being the local data, but for non-cached queries, the server is often faster.
{% /callout %}
## Adding SSR to your projects
If this all sounds good to you, you can add SSR to your projects today.
-Here’s the step by step guide.
+Here’s the step-by-step guide.
### 1. Replace your `db` client
@@ -123,7 +123,7 @@ export const { POST } = createInstantRouteHandler({
});
```
-Once we do this, Instant can start to detect the logged in user both in the browser and in the server.
+Once we do this, Instant can start to detect the logged-in user both in the browser and on the server.
### 3. Create an InstantProvider
@@ -172,7 +172,7 @@ export default async function RootLayout({ children }) {
}
```
-If using the NextJS pages directory, you can use `getServerSideProps` to get the user and pass it to the provider via the PageProps.
+If using the Next.js pages directory, you can use `getServerSideProps` to get the user and pass it to the provider via the PageProps.
This (a) fetches the current user, and (b) puts the Instant provider in the React tree.
@@ -192,7 +192,7 @@ export default function Page() {
}
```
-Note how there’s no `isLoading` or `error` state from db.useSuspenseQuery! This is handled using [React Suspense](https://react.dev/reference/react/Suspense), and makes sure we have the data when we render this page.
+Note how there’s no `isLoading` or `error` state from db.useSuspenseQuery! This is handled using [React Suspense](https://react.dev/reference/react/Suspense), which makes sure we have the data when we render this page.
If your code uses `useUser`, `useAuth`, or `db.SignedIn`/`db.SignedOut`, it will initially use the `user` value you provided to `InstantProvider` instead of a pending state. These hooks/components will continue to be reactive.
diff --git a/client/www/app/docs/page.md b/client/www/app/docs/page.md
index 4c84f25ddf..61b69fec36 100644
--- a/client/www/app/docs/page.md
+++ b/client/www/app/docs/page.md
@@ -6,13 +6,13 @@ nextjs:
description: How to use Instant with React
---
-Instant is the easy to use backend for your frontend. With Instant you can build delightful apps in less than 10 minutes. Follow the quick start below to **build a live app!**
+Instant is the easy-to-use backend for your frontend. With Instant you can build delightful apps in less than 10 minutes. Follow the quick start below to **build a live app!**
## Automatic Setup With Create Instant App
The fastest way to get started with Instant is to use `npx create-instant-app` to scaffold a new project with Instant already set up.
-To get started with Next.JS run:
+To get started with Next.js run:
```bash {% showCopy=true %}
npx create-instant-app --next
@@ -40,8 +40,8 @@ Add the InstantDB React Library:
npm i @instantdb/react
```
-Setup and connect your Instant app.
-This will log you in if you are not logged in already, then create a schema and permissions file, and update your `.env` file.
+Set up and connect your Instant app.
+This will log you in if you are not logged in already, then create schema and permissions files, and update your `.env` file.
```shell
npx instant-cli init
@@ -62,7 +62,7 @@ export const db = init({
});
```
-You're now ready to make queries and transactions to your database!
+You're now ready to run queries and transactions against your database!
### Creating a To-Do List App
@@ -292,6 +292,6 @@ Go to `localhost:3000`, and huzzah 🎉 You've got a fully functional todo list
Want to dive deeper on how this todo app works? Check out our step-by-step [Todo List Tutorial](/examples/todos). In this tutorial we walk through how to build the above todo list app from scratch, and explain how the queries and transactions work in more detail.
-You can also check out the [Working with data](/docs/init) section to learn more Instant concepts.
+You can also check out the [Working with data](/docs/init) section to learn more about Instant concepts.
As you get more familiar with Instant, check out our [Recommended Workflow](/docs/workflow) docs for using Instant in your projects.
diff --git a/client/www/app/docs/patterns/page.md b/client/www/app/docs/patterns/page.md
index 7c66513f8d..9a2cc9727f 100644
--- a/client/www/app/docs/patterns/page.md
+++ b/client/www/app/docs/patterns/page.md
@@ -6,12 +6,12 @@ nextjs:
---
Below are some common patterns for working with InstantDB. We'll add more
-patterns over time and if you have a pattern you'd like to share, please feel
+patterns over time, and if you have a pattern you'd like to share, please feel
free to submit a PR for this page.
## You can expose your app id to the client.
-Similar to Firebase, the app id is a unique identifier for your application.
+As with Firebase, the app id is a unique identifier for your application.
If you want to secure your data, you'll want to add
[permissions](/docs/permissions) for the app.
@@ -32,17 +32,17 @@ This will prevent any new attributes from being created.
When you query a namespace, it will return all the attributes for an entity.
You can use the [`fields`](/docs/instaql#select-fields) clause to restrict which attributes
-are returned from the server but this will not prevent a client from doing
+are returned from the server, but this will not prevent a client from doing
another query to get the full entity.
-You can set special permission rules for [`fields`](/docs/instaql/#fields), to make sure only certain attributes
+You can set special permission rules for [`fields`](/docs/instaql#select-fields) to make sure only certain attributes
are visible to certain users.
## Find entities with no links.
If you want to find entities that have no links, you can use the `$isNull`
query filter. For example, if you want to find all posts that are not linked to
-an author you can do
+an author, you can do the following:
```javascript
const { isLoading, error, data } = db.useQuery({
@@ -95,7 +95,7 @@ const _schema = i.schema({
},
});
-// This helps TypeScript display nicer intellisense
+// This helps TypeScript display nicer IntelliSense
type _AppSchema = typeof _schema;
interface AppSchema extends _AppSchema {}
const schema: AppSchema = _schema;
@@ -111,8 +111,8 @@ import type { InstantRules } from '@instantdb/react';
// instant.perms.ts
// And now we reference the `owner` link for todos to check the number
// of todos a user has created.
-// (Note): Make sure the `owner` link is already defined in the schema.
-// before you can reference it in the permissions.
+// (Note): Make sure the `owner` link is already defined in the schema
+// before you reference it in the permissions.
const rules = {
todos: {
allow: {
@@ -126,9 +126,9 @@ export default rules;
## Listen to InstantDB connection status.
-Sometimes you want to let clients know when they are connected or disconnected
-to the DB. You can use `db.subscribeConnectionStatus` in vanilla JS or
-`db.useConnectionStatus` in React to listen to connection changes
+Sometimes you want to let clients know when they are connected to or disconnected
+from the DB. You can use `db.subscribeConnectionStatus` in vanilla JS or
+`db.useConnectionStatus` in React to listen to connection changes.
```javascript
// Vanilla JS
@@ -234,13 +234,13 @@ console.log(
);
```
-Once you have an ID, you can pass it around in your transactions and queries, and use them in [ruleParams](/docs/permissions#rule-params).
+Once you have an ID, you can pass it around in your transactions and queries and use it in [ruleParams](/docs/permissions#rule-params).
-## Making admin queries work with NextJS Caching
+## Making admin queries work with Next.js caching
-NextJS caches fetch requests and lets you revalidate them. [`adminDB.query`](/docs/backend#query) uses fetch under the hood, so NextJS caching will work by default.
+Next.js caches fetch requests and lets you revalidate them. [`adminDB.query`](/docs/backend#query) uses fetch under the hood, so Next.js caching will work by default.
-If you want to finely control how the query caches, you can pass in the same kind of [fetch options](https://nextjs.org/docs/app/building-your-application/caching#fetch) for NextJS. For example, to revalidate a query every hour:
+If you want to finely control how the query caches, you can pass in the same kind of [fetch options](https://nextjs.org/docs/app/building-your-application/caching#fetch) for Next.js. For example, to revalidate a query every hour:
```js
await adminDB.query(
@@ -364,12 +364,12 @@ follow this workflow:
Complicated queries or large transactions may fail due to timeouts. Right now we
have a hard limit of 5 seconds for both queries and transactions. We do this to
-ensure real-time doesn't suffer from long-running operations.
+ensure realtime updates don't suffer from long-running operations.
To get a sense for how long a query or transaction takes, you can use the
`Sandbox` tab in the dashboard. Using `await db.query` or `await db.transact` will
show you the time it took to run the operation in the console. Queries and
-transactions in the sandbox can run for up to 30 seconds,
+transactions in the sandbox can run for up to 30 seconds.
Once you have a sense of how long your queries and transactions take, you can
iteratively optimize them. For example, you can use pagination or add indexes
diff --git a/client/www/app/docs/permissions/page.md b/client/www/app/docs/permissions/page.md
index 1bd6b97c52..eaef6aea94 100644
--- a/client/www/app/docs/permissions/page.md
+++ b/client/www/app/docs/permissions/page.md
@@ -45,7 +45,7 @@ With Instant you can define your permissions in code. If you haven't already, us
npx instant-cli@latest init
```
-The CLI will guide you through picking an Instant app and generate these files for you. Once you've made changes to `instant.perms.ts`, you can use the CLI to push those changes to production:
+The CLI will guide you through picking an Instant app and generate this file for you. Once you've made changes to `instant.perms.ts`, you can use the CLI to push those changes to production:
```shell {% showCopy=true %}
npx instant-cli@latest push perms
@@ -53,7 +53,7 @@ npx instant-cli@latest push perms
## Permissions in the dashboard
-For each app in your dashboard, you’ll see a permissions editor. Permissions are expressed as JSON. Each top level key represents one of your namespaces — for example `goals`, `todos`, and the like. There is also a special top-level key `attrs` for defining permissions on creating new types of namespaces and attributes.
+For each app in your dashboard, you’ll see a permissions editor. Permissions are expressed as JSON. Each top-level key represents one of your namespaces — for example `goals`, `todos`, and the like. There is also a special top-level key `attrs` for defining permissions for creating new types of namespaces and attributes.
## Namespaces
@@ -61,7 +61,7 @@ For each namespace you can define `allow` rules for `view`, `create`, `update`,
If a rule is not set then by default it evaluates to true. The following three rulesets are all equivalent:
-In this example we explicitly set each action for `todos` to true
+In this example we explicitly set each action for `todos` to true:
```json
{
@@ -77,7 +77,7 @@ In this example we explicitly set each action for `todos` to true
```
In this example we explicitly set `view` to be true. However, all the remaining
-actions for `todo` also default to true.
+actions for `todos` also default to true.
```json
{
@@ -133,7 +133,7 @@ You can also define field-level permissions. For example, you may want to make t
### Default permissions
-By default, all permissions are considered to be `"true"`. To change that, use `"$default"` key. This:
+By default, all permissions are considered to be `"true"`. To change that, use the `"$default"` key. This:
```json
{
@@ -207,9 +207,9 @@ Finally, the ultimate default:
Attrs are a special kind of namespace for creating new types of data on the fly.
Currently we only support create rules on attrs. During development you likely don't
need to lock this rule down, but once you ship you will likely want to set this
-permission to `false`
+permission to `false`.
-Suppose our data model looks like this
+Suppose our data model looks like this:
```json
{
@@ -217,7 +217,7 @@ Suppose our data model looks like this
}
```
-And we have rules defined as
+And we have rules defined as:
```json
{
@@ -266,7 +266,7 @@ In `update`, you'll also have access to `newData`. This refers to the changes th
### bind
-`bind` allows you to alias logic. The following are equivalent
+`bind` allows you to alias logic. The following are equivalent:
```json
{
@@ -289,7 +289,7 @@ In `update`, you'll also have access to `newData`. This refers to the changes th
}
```
-`bind` is useful for not repeating yourself and tidying up rules
+`bind` is useful for not repeating yourself and tidying up rules.
```json
{
@@ -336,7 +336,7 @@ See [managing users](/docs/users) to learn more about that.
### ruleParams
-Imagine you have a `documents` namespace, and want to implement a rule like _"Only people who know my document's id can access it."_
+Imagine you have a `documents` namespace and want to implement a rule like _"Only people who know my document's id can access it."_
You can use `ruleParams` to write that rule. `ruleParams` let you pass extra options to your queries and transactions.
@@ -380,7 +380,7 @@ With that, you've implemented the rule _"Only people who know my document's id c
### request.time
-The timestamp when the rules were run. You might use this in an update or create rule to ensure that a time is valid:
+The timestamp when the rules are run. You might use this in an update or create rule to ensure that a time is valid:
```json
{
@@ -500,7 +500,7 @@ This rule allows non-owners to update `likes` and `title`, but only if `likes` i
**Here are some more patterns**
-If you want to: access a document and _all related comments_ by one `knownDocId`:
+If you want to access a document and _all related comments_ with one `knownDocId`:
```json
{
diff --git a/client/www/app/docs/platform-api/page.md b/client/www/app/docs/platform-api/page.md
index c3b9733dee..59c37f3f75 100644
--- a/client/www/app/docs/platform-api/page.md
+++ b/client/www/app/docs/platform-api/page.md
@@ -8,7 +8,7 @@ nextjs:
You can use Instant to programmatically create apps, push schemas and manage permissions. This is particularly powerful in two scenarios:
- **App Builders**: If you're an app builder, you can give your customers a backend. It takes only an hour to set up the platform, and every app your users create gets a full backend as a result. LLMs are great at using Instant: they can make more progress with fewer tokens and fewer mistakes.
-- **Software teams**: If you're a software team you can improve your development workflows: create apps for different pull requests, or spin up temporary apps for tests.
+- **Software teams**: If you're a software team, you can improve your development workflows: create apps for different pull requests, or spin up temporary apps for tests.
In this document, we'll show you:
@@ -21,7 +21,7 @@ Let's get into it!
## CLI & SDK
-To manage apps you have two main tools at your disposal.
+To manage apps, you have two main tools at your disposal.
You can either use the Instant CLI:
@@ -41,11 +41,11 @@ Let's see how to use them.
First things first, let's create a temporary app.
-A temporary app is an Instant app that deletes itself in 2 weeks. You can use them to run quick experiments or spin apps up for tests.
+A temporary app is an Instant app that deletes itself in 2 weeks. You can use it to run quick experiments or spin apps up for tests.
You don't need to authenticate to create temporary apps, so they're a great way to get a sense of our tools.
-**Here's how to make a temporary app with CLI:**
+**Here's how to make a temporary app with the CLI:**
```bash
npx instant-cli init-without-files --title my-new-app --temp
@@ -133,13 +133,13 @@ Once you click "New Access Token", you'll get a token that looks like this:
per_xxx11x1xxx1xx1x11x1x1111xxx1xx11x11xxxx1x1x1x1111xxx11111xxx111x
```
-When you use this token to create apps, they will get associated to the account where you created the token.
+When you use this token to create apps, they will get associated with the account where you created the token.
**Option 2: Let users Sign in with Instant**
-Alternatively, you can create a "Sign in with Instant" button in your app. This button would let end-users provide their own Instant accounts, and give you permissions to manage apps on their behalf.
+Alternatively, you can create a "Sign in with Instant" button in your app. This button would let end-users provide their own Instant accounts and give you permissions to manage apps on their behalf.
-To do this, you can use the Platform SDK and set up Oauth. Follow the tutorial in the [Platform Oauth Guide](https://github.com/instantdb/instant/tree/main/client/packages/platform#oauth-flow) to see how to do that.
+To do this, you can use the Platform SDK and set up OAuth. Follow the tutorial in the [Platform OAuth Guide](https://github.com/instantdb/instant/tree/main/client/packages/platform#oauth-flow) to see how to do that.
When you're done and a user clicks "Sign in with Instant" in your app, you'll get a token that looks like this:
@@ -147,7 +147,7 @@ When you're done and a user clicks "Sign in with Instant" in your app, you'll ge
prt_xxx11x1xxx1xx1x11x1x1111xxx1xx11x11xxxx1x1x1x1111xxx11111xxx111x
```
-When you use this token to create apps, they will get associated to that user's account.
+When you use this token to create apps, they will get associated with that user's account.
### Create long-lived apps
diff --git a/client/www/app/docs/presence-and-topics/page.md b/client/www/app/docs/presence-and-topics/page.md
index 32ecec293b..cbaf1b6c83 100644
--- a/client/www/app/docs/presence-and-topics/page.md
+++ b/client/www/app/docs/presence-and-topics/page.md
@@ -21,19 +21,19 @@ A room represents a temporary context for realtime events. Users in the same roo
**Presence**
-Presence is an object that each peer shares with every other peer. When a user updates their presence, it's instantly replicated to all users in that room. Presence persists throughout the remainder of a user's connection, and is automatically cleaned up when a user leaves the room.
+Presence is an object that each peer shares with every other peer. When a user updates their presence, it's instantly replicated to all users in that room. Presence persists throughout the remainder of a user's connection and is automatically cleaned up when a user leaves the room.
You can use presence to build features like "who's online." Instant's cursor and typing indicator are both built on top of the presence API.
**Topics**
-Topics have "fire and forget" semantics, and are better suited for data that doesn't need any sort of persistence. When a user publishes a topic, a callback is fired for every other user in the room listening for that topic.
+Topics have "fire-and-forget" semantics and are better suited for data that doesn't need any sort of persistence. When a user publishes a topic, a callback is fired for every other user in the room listening for that topic.
You can use topics to build features like "live reactions." The real-time emoji button panel on Instant's homepage is built using the topics API.
**Transact vs. Ephemeral**
-You may be thinking when would I use `transact` vs `presence` vs `topics`? Here's a simple breakdown:
+You may be thinking: when would I use `transact` vs `presence` vs `topics`? Here's a simple breakdown:
- Use `transact` when you need to persist data to the db. For example, when a user sends a message in a chat app.
- Use `presence` when you need to persist data in a room but not to the db. For example, showing
@@ -42,7 +42,7 @@ You may be thinking when would I use `transact` vs `presence` vs `topics`? Here'
## Setup
-To obtain a room reference, call `db.room(roomType, roomId)`
+To obtain a room reference, call `db.room(roomType, roomId)`:
```typescript
import { init } from '@instantdb/react';
@@ -105,7 +105,7 @@ const _schema = i.schema({
},
});
-// This helps TypeScript display better intellisense
+// This helps TypeScript display better IntelliSense
type _AppSchema = typeof _schema;
interface AppSchema extends _AppSchema {}
const schema: AppSchema = _schema;
@@ -114,7 +114,7 @@ export type { AppSchema };
export default schema;
```
-Once you've updated your schema, you'll start seeing types in your intellisense:
+Once you've updated your schema, you'll start seeing types in your IntelliSense:
{% screenshot src="/img/docs/presence-intellisense.png" /%}
@@ -122,7 +122,7 @@ Once you've updated your schema, you'll start seeing types in your intellisense:
One common use case for presence is to show who's online.
-Instant's `usePresence` is similar in feel to `useState`. It returns an object containing the current user's presence state, the presence state of every other user in the room, and a function (`publishPresence`) to update the current user's presence. `publishPresence` is similar to React's `setState`, and will merge the current and new presence objects.
+Instant's `usePresence` is similar in feel to `useState`. It returns an object containing the current user's presence state, the presence state of every other user in the room, and a function (`publishPresence`) to update the current user's presence. `publishPresence` is similar to React's `setState` and will merge the current and new presence objects.
```tsx
import { init } from '@instantdb/react';
@@ -501,7 +501,7 @@ function UserAvatar({ peer }: { peer: ChatPeer }) {
}
function OnlineAvatars({ name, avatar }: { name: string; avatar: string }) {
- // Subcribe and publish initial presence
+ // Subscribe and publish initial presence
const { user: myPresence, peers } = db.rooms.usePresence(room, {
initialPresence: { name, avatar },
});
diff --git a/client/www/app/docs/self-hosting/aws/page.md b/client/www/app/docs/self-hosting/aws/page.md
index b9dbc93c0f..73f900cb91 100644
--- a/client/www/app/docs/self-hosting/aws/page.md
+++ b/client/www/app/docs/self-hosting/aws/page.md
@@ -5,9 +5,9 @@ nextjs:
description: 'Run Instant with multiple backend servers and Aurora PostgreSQL.'
---
-For more serious projects where you need higher availability and point in time
-restores we recommend starting with two backend servers and
-Aurora PostgreSQL. This is the same general architecture Instant Cloud used and
+For more serious projects where you need higher availability and point-in-time
+restores, we recommend starting with two backend servers and
+Aurora PostgreSQL. This is the same general architecture Instant Cloud uses and
lets you scale the backend and database separately.
The resources and instance types are up to you. The important parts are how the
@@ -178,14 +178,9 @@ Set a service name on every backend:
SWARM_SERVICE_NAME=server
```
-Configure private DNS so that:
-
-```
-tasks.server
-```
-
-resolves to the private IP address of every backend task. Each task must be able
-to reach the others over TCP ports 5701–5708 and 5801–5808.
+Configure private DNS so that `tasks.server` resolves to the private IP address
+of every backend task. Each task must be able to reach the others over TCP ports
+5701–5708 and 5801–5808.
ECS with AWS Cloud Map, Docker Swarm DNSRR, or another scheduler that provides
equivalent private DNS can satisfy this requirement.
diff --git a/client/www/app/docs/self-hosting/migrate/page.md b/client/www/app/docs/self-hosting/migrate/page.md
index 4aaf66bf81..65763f0cf8 100644
--- a/client/www/app/docs/self-hosting/migrate/page.md
+++ b/client/www/app/docs/self-hosting/migrate/page.md
@@ -22,8 +22,7 @@ Before restoring your app:
- [Configure Postmark](/docs/self-hosting#configure-email-with-postmark) so magic code emails work.
- [Restrict dashboard signups](/docs/self-hosting#restrict-dashboard-signups) and [disable temporary apps](/docs/self-hosting#temporary-apps) to prevent unwanted app creation.
-- Similarly if your app uses webhooks you'll need to configure those for your
- self-hosted app.
+- Configure webhooks for your self-hosted app if your app uses them.
If your app uses OAuth for end-user sign-in, recreate each OAuth provider on
the restored app. Copy its client ID, client secret, and any other provider
@@ -38,12 +37,12 @@ Keep the Instant Cloud callback configured until the migration is complete.
### Restore a test backup
Migrating without data loss will require some downtime. To get a sense of how
-much time it will take we'll
+much time it will take, we'll do the following:
1. Export a backup from Instant Cloud
-2. Restore the backup into your self hosted Instant.
+2. Restore the backup into your self-hosted Instant.
-After restoring verify the following look correct:
+After restoring, verify that the following look correct:
- Schema and permissions
- Application data
@@ -53,8 +52,8 @@ After restoring verify the following look correct:
### Prepare the client change
-After successfully restoring we can put up a PR to update our clients to point
-to our new self-hosted Instant app.
+After successfully restoring the test backup, we can put up a PR to update our
+clients to point to our new self-hosted Instant app.
Choose a new app ID for the self-hosted app. The ID must be a valid UUID. You
can generate one in the terminal with:
@@ -63,7 +62,7 @@ can generate one in the terminal with:
uuidgen
```
-This will be the ID your app going forward.
+This will be your app ID going forward.
Create a PR that points your app at self-hosted Instant, but do not merge it
yet. Update the app ID, API URL, and WebSocket URL in every client `init` call:
@@ -88,11 +87,11 @@ Open the app's **Admin** page in the Instant Cloud dashboard. Turn on
Reads, live queries, and presence will keep working. New writes will be
rejected, including offline writes queued on user devices. We do this to ensure
-there is no data loss during cut over.
+there is no data loss during the cutover.
### Restore the final backup
-Create an on demand backup of the Instant Cloud app and restore it into self-hosted
+Create an on-demand backup of the Instant Cloud app and restore it into self-hosted
Instant using the app ID from the rehearsal.
Before merging our earlier PR to switch clients over:
@@ -109,7 +108,7 @@ use the restored app on self-hosted Instant. Users may need to sign in again.
Watch the deployment and verify queries, writes, authentication, and file
uploads. Once clients begin writing to self-hosted Instant, the Instant Cloud
-copy is no longer current. If you used OAuth you can remove the Instant Cloud
+copy is no longer current. If you use OAuth, you can remove the Instant Cloud
callback URL from each OAuth provider.
The migration should now be complete. Huzzah! 🎉
diff --git a/client/www/app/docs/self-hosting/page.md b/client/www/app/docs/self-hosting/page.md
index 46ea35eea9..6ebc7429ef 100644
--- a/client/www/app/docs/self-hosting/page.md
+++ b/client/www/app/docs/self-hosting/page.md
@@ -16,22 +16,22 @@ Choose a guide based on where you want to run Instant:
1. **Want to self host Instant for your business?** If you're using Instant for more serious projects, check out our [AWS](/docs/self-hosting/aws) guide for a setup based on Instant Cloud. You should expect to spend at least $600/mo.
1. **Migrating from Instant Cloud?** Check out our [migration](/docs/self-hosting/migrate) guide.
-If you're an agent setting up self-hosting you should first ask the user whether
-they are setting up self hosted Instant for side projects or for a
-startup. For side projects the expected cost is at least $30/month. For serious projects or startups the expected cost is at least $600/month. Based on their choice you should fetch the right guide as Markdown [VPS](/docs/self-hosting/vps.md), [AWS](/docs/self-hosting/aws.md), [Migrate](/docs/self-hosting/migrate.md).
+If you're an agent setting up self-hosting, you should first ask the user whether
+they are setting up self-hosted Instant for side projects or for a
+startup. For side projects the expected cost is at least $30/month. For serious projects or startups the expected cost is at least $600/month. Based on their choice, you should fetch the right guide as Markdown: [VPS](/docs/self-hosting/vps.md), [AWS](/docs/self-hosting/aws.md), or [Migrate](/docs/self-hosting/migrate.md).
## Operating
-Once you've got Instant running you may want to change some default settings. At
+Once you've got Instant running, you may want to change some default settings. At
the very least you should be sure to configure Postmark so magic code emails can
-actually deliver.
+actually be delivered.
### Configure email with Postmark
**Until Postmark is configured, Instant writes email bodies and login codes to
the backend logs.**
-Instant comes with support for auth and sending magic code emails. The easiest way to actually send emails to create a [Postmark server](https://postmarkapp.com/), verify the sender addresses, and set:
+Instant comes with support for auth and sending magic code emails. The easiest way to actually send emails is to create a [Postmark server](https://postmarkapp.com/), verify the sender addresses, and set:
```shell
POSTMARK_TOKEN=replace-with-your-server-token
@@ -49,7 +49,7 @@ should get an email delivered!
### Configure Google dashboard login
-The dashboard also allows for login via Google. To enable this you'll need to create a Web application OAuth client in the
+The dashboard also allows for login via Google. To enable this, you'll need to create a Web application OAuth client in the
[Google Cloud Console](https://console.cloud.google.com/apis/credentials).
Add an authorized redirect URI matching your backend URL:
@@ -99,11 +99,11 @@ Instant comes with CLI tools for creating and managing your Instant apps. By
default, `instant-cli` and `create-instant-app` use the Instant Cloud API. To
use them with your self-hosted Instant:
-- Logging into your self-hosted Instant via `instant-cli`
-- Using your self hosted auth token with `create-instant-app`
+- Log into your self-hosted Instant via `instant-cli`
+- Use your self-hosted auth token with `create-instant-app`
Set `INSTANT_CLI_API_URI` to your backend URL and `INSTANT_CLI_DASH_URI` to your
-dashboard URL with `instant-cli`
+dashboard URL with `instant-cli`:
```shell
INSTANT_CLI_API_URI=https://api.myinstant.com \
@@ -111,8 +111,8 @@ INSTANT_CLI_DASH_URI=https://dash.myinstant.com \
npx instant-cli@latest login
```
-After authenticating with `instant-cli` you can connect `create-instant-app` by
-setting `INSTANT_CLI_API_URI`
+After authenticating, you can use the auth token associated with your self-hosted
+Instant in `create-instant-app` by setting `INSTANT_CLI_API_URI`:
```shell
INSTANT_CLI_API_URI=https://api.myinstant.com npx create-instant-app@latest
@@ -129,9 +129,9 @@ export default {
};
```
-If you include `INSTANT_CLI_DASH_URI` when you call `create-instant-app`
-your self hosted dashboard url will also be added to `instant.config.ts`. This
-can be helpful for authenticating with `instant-cli` if you're not logged in
+If you include `INSTANT_CLI_DASH_URI` when you call `create-instant-app`,
+your self-hosted dashboard URL will also be added to `instant.config.ts`. This
+can be helpful for authenticating with `instant-cli` if you're not logged in.
```shell
# Run this from your terminal
@@ -140,7 +140,7 @@ INSTANT_CLI_DASH_URI=https://dash.myinstant.com \
npx create-instant-app@latest
```
-Which will then add the following to your project
+This will then add the following to your project:
```ts
// instant.config.ts
diff --git a/client/www/app/docs/start-python/page.md b/client/www/app/docs/start-python/page.md
index 91e6b5f075..ba60148219 100644
--- a/client/www/app/docs/start-python/page.md
+++ b/client/www/app/docs/start-python/page.md
@@ -5,8 +5,8 @@ nextjs:
description: 'How to use Instant from Python with the admin SDK.'
---
-Instant offers a Python admin SDK with an API that mirrors our javascript
-admin SDK. If you read the JS docs, you can mentally substitute Python syntax
+Instant offers a Python Admin SDK with an API that mirrors our JavaScript
+Admin SDK. If you read the JS docs, you can mentally substitute Python syntax
and write working code.
## Install
@@ -40,7 +40,7 @@ Pythonic adjustments. A basic example looks like this:
from instantdb import Instant, id
db = Instant(
- # You can pass these explicitly, by default they fall back to
+ # You can pass these explicitly; by default they fall back to
# INSTANT_APP_ID and INSTANT_APP_ADMIN_TOKEN environment variables
app_id="__APP_ID__",
admin_token="__ADMIN_TOKEN__",
@@ -91,7 +91,7 @@ Everything else works on both the sync and async client.
## Schema and permissions
The Python starter includes `instant.schema.ts` and `instant.perms.ts`
-so you can manage your app from your python project. Push changes with
+so you can manage your app from your Python project. Push changes with
the Instant CLI as you would normally:
```shell {% showCopy=true %}
@@ -101,10 +101,10 @@ npx instant-cli push
## FastAPI with Pydantic
At the moment the SDK doesn't generate Python types from your schema file.
-Queries return as dictionaries. If you want typed objects, define them in your
+Query results are returned as dictionaries. If you want typed objects, define them in your
application and validate the returned data there.
-Here's an example of how you can use Pydantic models in a FastAPI app
+Here's an example of how you can use Pydantic models in a FastAPI app:
```python {% showCopy=true %}
from fastapi import FastAPI
@@ -195,7 +195,7 @@ See [Writing data](/docs/instaml) for the full mutation reference.
## Subscribing to queries
`AsyncInstant.subscribe_query` opens an SSE stream and yields payloads as
-the query result changes. Similar to our JS SDK:
+the query result changes. This is similar to our JS SDK:
```python {% showCopy=true %}
import asyncio
@@ -335,7 +335,7 @@ db.auth.sign_out(email="alyssa@instantdb.com")
## Impersonation
-You can also use the impersonation api to run queries and transactions as if you
+You can also use the impersonation API to run queries and transactions as if you
were a specific user or guest.
```python {% showCopy=true %}
@@ -483,7 +483,7 @@ Returned dicts keep camelCase wire-format keys (`webhookId`,
### Receiving webhooks
-Three primitives compose into framework integration:
+Three primitives compose into a framework integration:
```python
# 1. Verify the Ed25519 signature and parse the signed body
diff --git a/client/www/app/docs/start-rn/page.md b/client/www/app/docs/start-rn/page.md
index 54f09f03dd..d4beb79b23 100644
--- a/client/www/app/docs/start-rn/page.md
+++ b/client/www/app/docs/start-rn/page.md
@@ -124,7 +124,7 @@ const styles = StyleSheet.create({
export default App;
```
-If you haven't already, install the Expo Go app on iOS or Android. Once you have that installed you can run the app from your terminal.
+If you haven't already, install the Expo Go app on iOS or Android. Once you have that installed, you can run the app from your terminal.
```
npm run start
@@ -136,7 +136,7 @@ Huzzah 🎉 You've got your first React Native Instant app running! Check out th
## Using MMKV for faster storage (optional)
-By default, Instant uses [AsyncStorage](https://react-native-async-storage.github.io/async-storage/) to persist data on device. If you want faster read/write performance, you can use [MMKV](https://github.com/mrousavy/react-native-mmkv) instead.
+By default, Instant uses [AsyncStorage](https://react-native-async-storage.github.io/async-storage/) to persist data on the device. If you want faster read/write performance, you can use [MMKV](https://github.com/mrousavy/react-native-mmkv) instead.
### Install the MMKV package
@@ -279,10 +279,10 @@ This video goes through core concepts of using Instant like setting up schema, w
For more advanced features, check out [Simon Grimm](https://x.com/schlimmson) building a mobile app builder with Instant!
-In this video Simon builds on top of the concepts from Beto's video and shows off how to use Storage for uploading assets and the Platform API for programmatically spinning up databases.
+In this video, Simon builds on top of the concepts from Beto's video and shows off how to use Storage for uploading assets and the Platform API for programmatically spinning up databases.
{% youtube src="https://www.youtube.com/watch?v=HRACNTmikZI" title="Use React Native + InstantDB to Build a Self-Building App" /%}
-If you prefer reading docs, you can also check out the [Working with data](/docs/init) section to learn more Instant concepts.
+If you prefer reading docs, you can also check out the [Working with data](/docs/init) section to learn more about Instant concepts.
As you get more familiar with Instant, check out our [Recommended Workflow](/docs/workflow) docs for using Instant in your projects.
diff --git a/client/www/app/docs/start-solidjs/page.md b/client/www/app/docs/start-solidjs/page.md
index a5ec8de239..322075fabb 100644
--- a/client/www/app/docs/start-solidjs/page.md
+++ b/client/www/app/docs/start-solidjs/page.md
@@ -7,9 +7,9 @@ nextjs:
## Automatic Setup With Create Instant App
-The fastest way to get started with Instant with SolidJS is to use create-instant-app to scaffold a new project with Instant already set up.
+The fastest way to get started with Instant and SolidJS is to use create-instant-app to scaffold a new project with Instant already set up.
-To get started run:
+To get started, run:
```shell
npx create-instant-app -b solidjs-vite
@@ -29,7 +29,7 @@ Add the InstantDB SolidJS Library:
npm i @instantdb/solidjs
```
-Use `instant-cli` to set up a new Instant project. This will prompt you to log in if you haven't already. It will then create a schema file, permissions file, and update your `.env` file.
+Use `instant-cli` to set up a new Instant project. This will prompt you to log in if you haven't already. It will then create schema and permissions files and update your `.env` file.
```shell
npx instant-cli init
@@ -50,7 +50,7 @@ export const db = init({
});
```
-You're now ready to make queries and transactions to your database!
+You're now ready to run queries and transactions against your database!
### Creating a To-Do List App
@@ -296,7 +296,7 @@ In Solid, query results are returned as [Signals](https://docs.solidjs.com/conce
Incorrect Usage:
```typescript
-// ❌ Data cannot be destructed from an Accessor
+// ❌ Data cannot be destructured from an Accessor
const { data } = db.useQuery({ todos: {} });
// ❌ state().data() must be called from a Tracking Scope
@@ -331,4 +331,4 @@ const TodoCount = () => {
}
```
-Transactions in Solid work the same way they do in React via `db.transact`. To learn more see our [writing data](/docs/instaml) docs.
+Transactions in Solid work the same way they do in React via `db.transact`. To learn more, see our [writing data](/docs/instaml) docs.
diff --git a/client/www/app/docs/start-svelte/page.md b/client/www/app/docs/start-svelte/page.md
index 4671eda339..01be58b8e6 100644
--- a/client/www/app/docs/start-svelte/page.md
+++ b/client/www/app/docs/start-svelte/page.md
@@ -7,9 +7,9 @@ nextjs:
## Automatic Setup With Create Instant App
-The fastest way to get started with Instant with SvelteKit is to use create-instant-app to scaffold a new project with Instant already set up.
+The fastest way to get started with Instant and SvelteKit is to use create-instant-app to scaffold a new project with Instant already set up.
-To get started run:
+To get started, run:
```shell
npx create-instant-app --sv
@@ -29,7 +29,7 @@ Add the InstantDB Svelte Library:
npm i @instantdb/svelte
```
-Use `instant-cli` to set up a new Instant project. This will prompt you to log in if you haven't already. It will then create a schema file, permissions file, and update your `.env` file.
+Use `instant-cli` to set up a new Instant project. This will prompt you to log in if you haven't already. It will then create schema and permissions files and update your `.env` file.
```shell
npx instant-cli init
@@ -50,7 +50,7 @@ export const db = init({
});
```
-You're now ready to make queries and transactions to your database!
+You're now ready to run queries and transactions against your database!
### Creating a To-Do List App
@@ -291,7 +291,7 @@ Transactions in Svelte work the same way they do in React via `db.transact`:
```
-To learn more see our [writing data](/docs/instaml) docs.
+To learn more, see our [writing data](/docs/instaml) docs.
## Auth
diff --git a/client/www/app/docs/start-tanstack/page.md b/client/www/app/docs/start-tanstack/page.md
index 8f9bf34e55..91e3fe1eb1 100644
--- a/client/www/app/docs/start-tanstack/page.md
+++ b/client/www/app/docs/start-tanstack/page.md
@@ -9,7 +9,7 @@ nextjs:
The fastest way to get started with Instant on TanStack Start is to use npx create-instant-app to scaffold a new project with Instant already set up.
-To get started run:
+To get started, run:
```shell
npx create-instant-app -b tanstack-start
@@ -17,7 +17,7 @@ npx create-instant-app -b tanstack-start
## Manual Setup
-The following guide demonstrates the basics for manually scaffolding a new tanstack project with Instant and managing data. In general we recommend the automatic setup above which includes all of this and a basic auth flow and other useful full-stack utilities.
+The following guide demonstrates the basics for manually scaffolding a new TanStack project with Instant and managing data. In general, we recommend the automatic setup above, which includes all of this, a basic auth flow, and other useful full-stack utilities.
Create a blank TanStack Start app:
@@ -31,7 +31,7 @@ Add the InstantDB React Library:
npm i @instantdb/react
```
-Use `instant-cli` to set up a new Instant project. This will prompt you to log in if you haven't already. It will then create a schema file, permissions file, and update your `.env` file.
+Use `instant-cli` to set up a new Instant project. This will prompt you to log in if you haven't already. It will then create schema and permissions files and update your `.env` file.
```shell
npx instant-cli init
@@ -52,7 +52,7 @@ export const db = init({
});
```
-You're now ready to make queries and transactions to your database!
+You're now ready to run queries and transactions against your database!
### Creating a To-Do List App
@@ -260,6 +260,6 @@ Want to dive deeper on how this todo app works? Check out our step-by-step [Todo
For the advanced use case of integrating with TanStack Query and enabling SSR, refer to our [tanstack-start-with-tanstack-query](https://github.com/instantdb/instant/tree/main/examples/tanstack-start-with-tanstack-query) example. It can be scaffolded using `npx create-instant-app -b tanstack-start-with-tanstack-query`.
-You can also check out the [Working with data](/docs/init) section to learn more Instant concepts.
+You can also check out the [Working with data](/docs/init) section to learn more about Instant concepts.
As you get more familiar with Instant, check out our [Recommended Workflow](/docs/workflow) docs for using Instant in your projects.
diff --git a/client/www/app/docs/start-vanilla/page.md b/client/www/app/docs/start-vanilla/page.md
index 3f519dfb40..cb43469976 100644
--- a/client/www/app/docs/start-vanilla/page.md
+++ b/client/www/app/docs/start-vanilla/page.md
@@ -5,9 +5,9 @@ nextjs:
description: 'How to use Instant with Vanilla JS'
---
-You can use Instant with plain ol' Javascript/Typescript too. You may find this helpful to integrate Instant with a framework that doesn't have an official SDK yet.
+You can use Instant with plain ol' JavaScript/TypeScript too. You may find this helpful to integrate Instant with a framework that doesn't have an official SDK yet.
-To use Instant in a brand new project fire up your terminal set up a new project with Vite.
+To use Instant in a brand new project, fire up your terminal and set up a new project with Vite.
```shell {% showCopy=true %}
npx create-vite@latest -t vanilla-ts instant-vanilla
diff --git a/client/www/app/docs/start-vue/page.md b/client/www/app/docs/start-vue/page.md
index 183243b09f..4813d1dbbe 100644
--- a/client/www/app/docs/start-vue/page.md
+++ b/client/www/app/docs/start-vue/page.md
@@ -7,9 +7,9 @@ nextjs:
## Automatic Setup With Create Instant App
-The fastest way to get started with Instant with Vue is to use create-instant-app to scaffold a new project with Instant already set up.
+The fastest way to get started with Instant and Vue is to use create-instant-app to scaffold a new project with Instant already set up.
-To get started run:
+To get started, run:
```shell
npx create-instant-app --vue
@@ -29,7 +29,7 @@ Add the InstantDB Vue Library:
npm i @instantdb/vue
```
-Use `instant-cli` to set up a new Instant project. This will prompt you to log in if you haven't already. It will then create a schema file, permissions file, and update your `.env` file.
+Use `instant-cli` to set up a new Instant project. This will prompt you to log in if you haven't already. It will then create schema and permissions files and update your `.env` file.
```shell
npx instant-cli init
@@ -50,7 +50,7 @@ export const db = init({
});
```
-You're now ready to make queries and transactions to your database!
+You're now ready to run queries and transactions against your database!
### Creating a To-Do List App
@@ -267,7 +267,7 @@ function deleteTodo(todoId: string) {
```
-To learn more see our [writing data](/docs/instaml) docs.
+To learn more, see our [writing data](/docs/instaml) docs.
## Auth
@@ -343,7 +343,7 @@ const room = db.room('main', 'my-room-id');
```
-The `Cursors` component supports custom cursor rendering via a scoped `cursor` slot, a configurable wrapper element (`as`), and inherits `class`/`style` from the parent. See the [Presence, Cursors, and Activity](/docs/presence-and-topics) docs for more details.
+The `Cursors` component supports custom cursor rendering via a scoped `cursor` slot and a configurable wrapper element (`as`), and it inherits `class`/`style` from the parent. See the [Presence, Cursors, and Activity](/docs/presence-and-topics) docs for more details.
## Nuxt
diff --git a/client/www/app/docs/storage/page.md b/client/www/app/docs/storage/page.md
index 065c02f3fc..24dbd50d88 100644
--- a/client/www/app/docs/storage/page.md
+++ b/client/www/app/docs/storage/page.md
@@ -10,7 +10,7 @@ You can store images, videos, documents, and any other file type.
## Storage quick start
-Let's build a full example of how to upload and display a grid of images
+Let's build a full example of how to upload and display a grid of images:
```shell {% showCopy=true %}
npx create-next-app instant-storage --tailwind --yes
@@ -18,7 +18,7 @@ cd instant-storage
npm i @instantdb/react
```
-Initialize your schema and permissions via the [cli tool](/docs/cli)
+Initialize your schema and permissions via the [CLI tool](/docs/cli):
```
npx instant-cli@latest init
@@ -43,7 +43,7 @@ const _schema = i.schema({
rooms: {},
});
-// This helps TypeScript display nicer intellisense
+// This helps TypeScript display nicer IntelliSense
type _AppSchema = typeof _schema;
interface AppSchema extends _AppSchema {}
const schema: AppSchema = _schema;
@@ -52,7 +52,7 @@ export type { AppSchema };
export default schema;
```
-Similarly open `instant.perms.ts` and replace the contents with the following
+Similarly, open `instant.perms.ts` and replace the contents with the following:
```javascript {% showCopy=true %}
import type { InstantRules } from "@instantdb/react";
@@ -72,7 +72,7 @@ const rules = {
export default rules;
```
-Push up both the schema and permissions to your Instant app with the following command
+Push up both the schema and permissions to your Instant app with the following command:
```shell {% showCopy=true %}
npx instant-cli@latest push
@@ -94,7 +94,7 @@ const APP_ID = process.env.NEXT_PUBLIC_INSTANT_APP_ID;
const db = init({ appId: APP_ID, schema });
// `uploadFile` is what we use to do the actual upload!
-// the `$files` will automatically update once the upload is complete
+// The `$files` query will automatically update once the upload is complete
async function uploadImage(file: File) {
try {
// Optional metadata you can set for uploads
@@ -250,13 +250,13 @@ upload and delete images!
## Storage client SDK
Below you'll find a more detailed guide on how to use the Storage API from
-react.
+React.
### Upload files
Use `db.storage.uploadFile(path, file, opts?)` to upload a file.
-- `path` determines where the file will be stored, and can be used with permissions to restrict access to certain files.
+- `path` determines where the file will be stored and can be used with permissions to restrict access to certain files.
- `file` should be a [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) type, which will likely come from a [file-type input](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file).
- `opts` can be used to set additional metadata like `contentType` and `contentDisposition`
@@ -431,7 +431,7 @@ await db.transact(
);
```
-`path` is a unique attribute so if another file exists with that path, then the transaction
+`path` is a unique attribute, so if another file exists with that path, then the transaction
will fail.
At the moment we only allow updating the `path` attribute of `$files`, as well as any custom columns you've created. If you
@@ -439,7 +439,7 @@ try to update another attribute like `content-type` the transaction will fail.
### Link files
-When the upload succeeds, `uploadFile` returns a `data` object containing a file ID associated with the uploaded file. You can use this id to link the file to other namespaces.
+When the upload succeeds, `uploadFile` returns a `data` object containing a file ID associated with the uploaded file. You can use this ID to link the file to other namespaces.
```javascript
async function uploadImage(file: File) {
@@ -454,7 +454,7 @@ async function uploadImage(file: File) {
```
[Check out this repo](https://github.com/jsventures/instant-storage-avatar-example)
-for a more detailed example showing how you may leverage links to implement an avatar upload feature
+for a more detailed example showing how you may leverage links to implement an avatar upload feature.
## Using Storage with React Native
@@ -486,7 +486,7 @@ const file = new File([blob], 'my_file.m4a', { type: 'audio/x-m4a' });
await db.storage.uploadFile('my_file.m4a', file);
```
-## Storage admin SDK
+## Storage Admin SDK
The Admin SDK offers a similar API for managing storage on the server. Permission
checks are not enforced when using the Admin SDK, so you can use it to manage
@@ -495,7 +495,7 @@ files without worrying about authentication.
### Uploading files
`db.storage.uploadFile(path, file, opts?)` is also available to upload a file
-on the backend. In the admin SDK, the `file` argument must either be a buffer
+on the backend. In the Admin SDK, the `file` argument must either be a buffer
or a stream.
```tsx
@@ -551,8 +551,8 @@ await db.transact(fileIds.map((id) => db.tx.$files[id].delete()));
### Link files
-Similar to the client SDK, after uploading a file, you can use the response to
-link the upload to other entities.
+As with the client SDK, you can use the response after uploading a file to link
+the upload to other entities.
```typescript
// Assume we have a user ID and a buffer for the file
@@ -568,11 +568,11 @@ By default, Storage permissions are disabled. This means that until you explicit
- _view_ permissions enable viewing `$files`
- _update_ permissions enable updating `$files`
- _delete_ permissions enable deleting `$files`
-- _view_ permissions on `$files` and _update_ permissions on the forward entity enabling linking and unlinking `$files`
+- _view_ permissions on `$files` and _update_ permissions on the forward entity enable linking and unlinking `$files`
In your permissions rules, you can use `auth` to access the currently authenticated user, and `data` to access the file metadata.
-At the moment, the only available file metadata is `data.path`, which represents the file's path in Storage. Here are some example permissions
+At the moment, the only available file metadata is `data.path`, which represents the file's path in Storage. Here are some example permissions:
Allow anyone to upload and retrieve files (easy to play with but not recommended for production):
@@ -601,7 +601,7 @@ Allow all authenticated users to view and upload files:
}
```
-Authenticated users may only upload, view, update files from their own subdirectory:
+Authenticated users may only upload, view, and update files from their own subdirectory:
```json
{
diff --git a/client/www/app/docs/streams/page.md b/client/www/app/docs/streams/page.md
index 31cd735361..794d586771 100644
--- a/client/www/app/docs/streams/page.md
+++ b/client/www/app/docs/streams/page.md
@@ -188,7 +188,7 @@ export async function POST(req) {
### resumable-stream
-[`@instantdb/resumable-stream`](https://www.npmjs.com/package/@instantdb/resumable-stream) is a drop-in replacement for Vercel's `resumable-stream` library that supports resuming ongoing streams after page reloads. It requires no Redis instance and your streams never expire.
+[`@instantdb/resumable-stream`](https://www.npmjs.com/package/@instantdb/resumable-stream) is a drop-in replacement for Vercel's `resumable-stream` library that supports resuming ongoing streams after page reloads. It requires no Redis instance, and your streams never expire.
#### Client-side: Enable stream resumption
diff --git a/client/www/app/docs/stripe-payments/page.md b/client/www/app/docs/stripe-payments/page.md
index 4348e7fae6..4609448bb0 100644
--- a/client/www/app/docs/stripe-payments/page.md
+++ b/client/www/app/docs/stripe-payments/page.md
@@ -8,7 +8,7 @@ nextjs:
The quickest way to add Stripe to your Instant app is to tell your LLM to do it. Just say "add Stripe payments" and follow along step by step.
For more guidance we've put together three reference examples with tutorials you
-can follow along. Each example also has additional docs you can copy and paste for your agent.
+can follow along with. Each example also has additional docs you can copy and paste for your agent.
## Stripe Examples
@@ -21,7 +21,7 @@ instantly.
### One-off purchase
This example is for a wallpaper store where users buy a pack and get immediate
-access to high-resolution downloads. It's a one-off payment and no user accounts required to minimize friction.
+access to high-resolution downloads. It's a one-off payment, and no user accounts are required to minimize friction.
- [Example repo](https://github.com/instantdb/instant/tree/main/examples/stripe-one-off) with [step-by-step tutorial](https://github.com/instantdb/instant/tree/main/examples/stripe-one-off/tutorial.md)
- [Strategy](https://raw.githubusercontent.com/instantdb/instant/main/examples/stripe-one-off/stripe-strategy.md) and [payment flow](https://raw.githubusercontent.com/instantdb/instant/main/examples/stripe-one-off/purchase.md) docs to help your agent implement the pattern
diff --git a/client/www/app/docs/teams/page.md b/client/www/app/docs/teams/page.md
index cf02014a2c..1fdd208384 100644
--- a/client/www/app/docs/teams/page.md
+++ b/client/www/app/docs/teams/page.md
@@ -29,7 +29,7 @@ App team members can have one of three roles: collaborator, admin or owner.
#### Inviting a team member
-A pro app's admin or owner simply needs to navigate to the [Dashboard Admin tab](https://instantdb.com/dash?s=main&t=admin) and click "Invite a team member". This will open a dialog that accepts an email and role. This will send an email with instructions to the specified address.
+A Pro app's admin or owner simply needs to navigate to the [Dashboard Admin tab](https://instantdb.com/dash?s=main&t=admin) and click "Invite a team member". This will open a dialog that accepts an email address and a role. This will send an email with instructions to the specified address.
#### Accepting an invite
diff --git a/client/www/app/docs/users/page.md b/client/www/app/docs/users/page.md
index c203fbbe89..b2fd98487b 100644
--- a/client/www/app/docs/users/page.md
+++ b/client/www/app/docs/users/page.md
@@ -94,7 +94,7 @@ const _schema = i.schema({
},
});
-// This helps TypeScript display nicer intellisense
+// This helps TypeScript display nicer IntelliSense
type _AppSchema = typeof _schema;
interface AppSchema extends _AppSchema {}
const schema: AppSchema = _schema;
@@ -105,7 +105,7 @@ export default schema;
### Links
-We created two links `userRoles`, `todoOwner`:
+We created two links, `userRoles` and `todoOwner`:
```typescript
// instant.schema.ts
@@ -315,7 +315,7 @@ export default {
```
You can also traverse the `$users` namespace directly from the `auth` object via
-`auth.ref`. When using `auth.ref` the arg must start with `$user`. Here's the
+`auth.ref`. When using `auth.ref`, the arg must start with `$user`. Here's the
equivalent rule to the one above using `auth.ref`:
```javascript
diff --git a/client/www/app/docs/using-llms/page.md b/client/www/app/docs/using-llms/page.md
index 8873d778c6..4ec2176110 100644
--- a/client/www/app/docs/using-llms/page.md
+++ b/client/www/app/docs/using-llms/page.md
@@ -19,9 +19,9 @@ This will give your agent the context it needs to work with InstantDB.
You can verify you set up the rules correctly by asking your LLM "How do you
make queries and transactions in InstantDB?" If everything is set up correctly,
-you should see a response with information about `db.useQuery` and `db.transact`
+you should see a response with information about `db.useQuery` and `db.transact`.
-If you'd prefer to manually install the rules instead see the section below.
+If you'd prefer to manually install the rules instead, see the section below.
## Instant Rules
@@ -39,8 +39,8 @@ You may need to restart your editor for the rules to take effect.
### Markdown Docs and llms.txt
-You can attach `.md` to the end of any doc page url to get raw markdown. This can be helpful to paste into your LLM if you're stuck on
-particular functionality. For example, here's the recommended docs for [adding auth](/docs/auth/magic-codes.md)
+You can attach `.md` to the end of any doc page URL to get raw Markdown. This can be helpful to paste into your LLM if you're stuck on
+particular functionality. For example, here are the recommended docs for [adding auth](/docs/auth/magic-codes.md).
We recommend starting with the rules files above and adding more docs as needed.
If you want though you can get all our docs at once in markdown format via
@@ -78,7 +78,7 @@ Or edit your `~/.cursor/mcp.json` directly:
### Claude Code
-If you're on a paid Claude plan, you can add the server via the command line
+If you're on a paid Claude plan, you can add the server via the command line:
```text {% showCopy="true" %}
claude mcp add instant -s user -t http https://mcp.instantdb.com/mcp
@@ -86,11 +86,11 @@ claude mcp add instant -s user -t http https://mcp.instantdb.com/mcp
Now you can run `claude` to start Claude Code and then run `/mcp` to see your list
of MCP servers. `instant` should be listed there. Select it and go through the
-auth flow to enable the Instant MCP server in your claude code sessions!
+auth flow to enable the Instant MCP server in your Claude Code sessions!
### Codex
-If you're on a paid OpenAI plan, you can add the server via the command line
+If you're on a paid OpenAI plan, you can add the server via the command line:
Edit your `~/.codex/config.toml` to include the [`rmcp_client` feature](https://developers.openai.com/codex/mcp/):
@@ -99,7 +99,7 @@ Edit your `~/.codex/config.toml` to include the [`rmcp_client` feature](https://
rmcp_client = true
```
-Tell codex to add the MCP server:
+Tell Codex to add the MCP server:
```text {% showCopy="true" %}
codex mcp add instant --url "https://mcp.instantdb.com/mcp"
@@ -111,7 +111,7 @@ Now run `codex` to start Codex. You can run `/mcp` to see Instant in your list.
### Gemini
-If you're on a paid Google AI plan, you can add the server via the command line
+If you're on a paid Google AI plan, you can add the server via the command line:
```text {% showCopy="true" %}
gemini mcp add --transport http instant https://mcp.instantdb.com/mcp
@@ -123,15 +123,15 @@ Now run `gemini` to start Gemini. You can run `/mcp` to see Instant in your list
### Windsurf
-You can add the Instant MCP server through the Windsurf UI
+You can add the Instant MCP server through the Windsurf UI:
1. Open Windsurf Settings.
2. Under Cascade, you'll find Model Context Protocol Servers.
3. Select Add Server and paste the relevant snippet for your OS.
-Alternatively you can directly edit your `~/.codeium/windsurf/mcp_config.json`
+Alternatively, you can directly edit your `~/.codeium/windsurf/mcp_config.json`:
-**MacOS/Linux**
+**macOS/Linux**
```json {% showCopy="true" %}
{
@@ -172,7 +172,7 @@ Alternatively you can directly edit your `~/.codeium/windsurf/mcp_config.json`
### Zed
-Open your Zed settings and add the following
+Open your Zed settings and add the following:
```json {% showCopy="true" %}
{
@@ -192,13 +192,13 @@ Open your Zed settings and add the following
### Other Tools
For other tools that support MCP servers, you can configure Instant using either our streamable HTTP
-endpoint (recommended if your tool supports it)
+endpoint (recommended if your tool supports it):
```text {% showCopy="true" %}
https://mcp.instantdb.com/mcp
```
-Or our SSE endpoint
+or our SSE endpoint:
```text {% showCopy="true" %}
https://mcp.instantdb.com/sse
@@ -206,7 +206,7 @@ https://mcp.instantdb.com/sse
## Local MCP server
-We recommend using our hosted MCP server but we also support running [`@instantdb/mcp`](https://github.com/instantdb/instant/tree/main/client/packages/mcp) locally
+We recommend using our hosted MCP server, but we also support running [`@instantdb/mcp`](https://github.com/instantdb/instant/tree/main/client/packages/mcp) locally
via `stdio`. This will avoid OAuth but requires you to manage your personal
access token.
@@ -223,7 +223,7 @@ favorite editor with MCP support.
You can set up the Instant MCP server in Cursor, Windsurf, or Cline by adding
the following configuration to your MCP settings:
-**MacOS/Linux**
+**macOS/Linux**
```json {% showCopy="true" %}
{
@@ -262,12 +262,12 @@ the following configuration to your MCP settings:
}
```
-Replacing `` with your personal access token. Save the file and reload
+Replace `` with your personal access token. Save the file and reload
the editor! You should now see the Instant MCP server active and enabled!
### Zed
-Open your Zed settings and add the following
+Open your Zed settings and add the following:
```json {% showCopy="true" %}
{
@@ -284,7 +284,7 @@ Open your Zed settings and add the following
}
```
-Replacing `` with your personal access token. Save the file and reload the editor.
+Replace `` with your personal access token. Save the file and reload the editor.
You should now see the Instant MCP server active and enabled!
### Claude Desktop
@@ -306,12 +306,12 @@ steps:
}
```
-Replacing `` with your personal access token. Save the file and restart
+Replace `` with your personal access token. Save the file and restart
Claude Desktop. You should now see the Instant MCP server active and enabled!
## MCP Tools
-Below is a list of the current tools we expose
+Below is a list of the current tools we expose:
- `learn` Fetch rules files if needed to help the LLM understand InstantDB.
- `get-schema` Retrieves the schema for a specific app.
diff --git a/client/www/app/docs/webhooks/page.md b/client/www/app/docs/webhooks/page.md
index 450a752b28..2eeedcc257 100644
--- a/client/www/app/docs/webhooks/page.md
+++ b/client/www/app/docs/webhooks/page.md
@@ -29,7 +29,7 @@ Each request carries an `Instant-Signature` header and a small body. The body ho
}
```
-`before` is `null` on `create`, `after` is `null` on `delete`. The `idempotencyKey` is stable across redeliveries — use it to dedupe if your handler isn't idempotent on its own.
+`before` is `null` on `create`; `after` is `null` on `delete`. The `idempotencyKey` is stable across redeliveries — use it to dedupe if your handler isn't idempotent on its own.
The `before` and `after` fields include all of the data attributes on an entity, but none of its links.
@@ -43,7 +43,7 @@ Instant retries failed deliveries with backoff. An event moves through these sta
- `error` — an attempt failed; another retry is scheduled
- `failed` — all retries exhausted; will not be retried automatically
-Each delivery attempt has a **15-second timeout** — if your endpoint hasn't responded by then the attempt is recorded as a `timeout` error and Instant retries. Do any slow work (sending emails, calling third-party APIs, etc.) asynchronously, and respond with `2xx` as soon as you've durably enqueued the work.
+Each delivery attempt has a **15-second timeout** — if your endpoint hasn't responded by then, the attempt is recorded as a `timeout` error and Instant retries. Do any slow work (sending emails, calling third-party APIs, etc.) asynchronously, and respond with `2xx` as soon as you've durably enqueued the work.
A webhook that fails too many times in a row is automatically disabled. You can re-enable it from the dashboard or via the SDK once you've fixed the receiver.
@@ -51,7 +51,7 @@ A webhook that fails too many times in a row is automatically disabled. You can
The easiest way to create a webhook is from the **Webhooks** tab in the dashboard: pick the namespaces, the actions, and the URL Instant should POST to.
-You can also manage webhooks programmatically with `npx instant-cli webhook` or through the admin SDK:
+You can also manage webhooks programmatically with `npx instant-cli webhook` or through the Admin SDK:
```ts {% showCopy=true %}
// scripts/create-webhook.ts
@@ -218,7 +218,7 @@ const payload = await db.webhooks.fetchPayloads({ payloadUrl, token });
## Managing webhooks programmatically
-`db.webhooks.manager` exposes CRUD on webhooks and access to their delivery history. Use it from the admin SDK when you want to provision webhooks from code (e.g. during onboarding) rather than from the dashboard.
+`db.webhooks.manager` exposes CRUD on webhooks and access to their delivery history. Use it from the Admin SDK when you want to provision webhooks from code (e.g. during onboarding) rather than from the dashboard.
```ts {% showCopy=true %}
// List
@@ -263,7 +263,7 @@ do {
cursor = pageInfo.hasNextPage ? pageInfo.endCursor : null;
} while (cursor);
-// Fetch one event by its isn (Instant Sequence Number)
+// Fetch one event by its ISN (Instant Sequence Number)
const event = await db.webhooks.manager.getEvent(hook.id, isn);
// Fetch the full payload for an event
@@ -275,7 +275,7 @@ await db.webhooks.manager.resendEvent(hook.id, isn);
Each `event.attempts` entry records the HTTP status, response body (first 256 bytes), duration, and an `errorType` tag (`timeout`, `dns`, `connect`, `tls`, `protocol`, `network`, `unknown`) when delivery failed — usually enough to tell whether the receiver is the problem or the network is.
-`resendEvent` is rate-limited per event; if you call it twice in quick succession the second call will return a validation error and ask you to wait about a minute.
+`resendEvent` is rate-limited per event; if you call it twice in quick succession, the second call will return a validation error and ask you to wait about a minute.
## Verifying and fetching from any language
@@ -292,7 +292,7 @@ Every webhook arrives as a `POST` with two things you care about:
```
- `t` — Unix timestamp (seconds) of when Instant signed the request
- - `kid` — id of the signing key
+ - `kid` — ID of the signing key
- `v1` — hex-encoded Ed25519 signature
- A JSON body containing a short-lived URL and JWT:
@@ -528,6 +528,6 @@ Authorization: Bearer
Accept: application/json
```
-The response contains `data` array of records, plus a top-level `idempotencyKey`. The `token` is short-lived and will only fetch the single payload.
+The response contains a `data` array of records, plus a top-level `idempotencyKey`. The `token` is short-lived and will only fetch the single payload.
Respond `2xx` once you've durably enqueued the records. Anything else (or no response within 15 seconds) is treated as a failure and the event is retried.
diff --git a/client/www/app/docs/workflow/page.md b/client/www/app/docs/workflow/page.md
index eb221d21b9..45bf144177 100644
--- a/client/www/app/docs/workflow/page.md
+++ b/client/www/app/docs/workflow/page.md
@@ -19,7 +19,7 @@ At a high level, here is the recommended workflow for developing with Instant:
## Authenticating with Instant in your terminal
Use the [Instant CLI](/docs/instant-cli) to authenticate with Instant in your
-terminal. After authenticating you'll be able to create new projects
+terminal. After authenticating, you'll be able to create new projects
and have them associated with your Instant account. This will also enable you to
push and pull changes to your projects. To authenticate, run:
@@ -32,12 +32,12 @@ This will open a browser window where you can log in or sign up for an account.
## Starting a new project
After authenticating, you can create a new project with
-[create-instant-app](/docs/create-instant-app). This will give you some starter code, and set up rules for your LLM
+[create-instant-app](/docs/create-instant-app). This will give you some starter code and set up rules for your LLM
agent. If your agent supports it, we also recommend setting up the [Instant MCP Server](/docs/using-llms#instant-mcp-server).
The default rules cover the basics of using InstantDB. But if you want to add
more docs for specific functionality, you can append `.md` to the end of any doc
-page URL to get the raw markdown. For example, here are the docs for
+page URL to get the raw Markdown. For example, here are the docs for
[adding auth](/docs/auth/magic-codes.md).
## Updating schema and permissions
@@ -74,7 +74,7 @@ Some examples of debug info you can see in the sandbox:
InstantDB has the following timeouts for queries and transactions:
- 5 seconds for queries and transactions with the client SDK.
-- 30 seconds for queries and transactions in the admin SDK and sandbox.
+- 30 seconds for queries and transactions in the Admin SDK and sandbox.
We set these timeouts intentionally for performance and reliability. We do not
allow timeouts to be configured. Sometimes fixing a timeout is as simple as
@@ -96,13 +96,13 @@ you run a query or transaction in the sandbox, you can see all the permission
checks that were run, and whether they passed or failed.
If it's unclear why a permission is returning false, re-run the transaction with the permission broken
-down into smaller pieces. For example, if you have a permission rule like
+down into smaller pieces. For example, if you have a permission rule like:
```
"view": "auth.id in data.ref('members.id')"
```
-It can be helpful to re-run the sandbox with the permission rule changed to
+It can be helpful to re-run the sandbox with the permission rule changed to:
```
"view": "data.ref('members.id')"