create-sidekick-app 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "create-sidekick-app",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "Scaffold a new web/mobile app with SidekickDB",
5
- "homepage": "https://github.com/SidekickDB/sidekick/tree/main/client/packages/create-instant-app",
5
+ "homepage": "https://sidekickdb.co/docs/create-instant-app",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git+https://github.com/SidekickDB/sidekick.git",
@@ -39,9 +39,9 @@
39
39
  "slugify": "^1.6.6",
40
40
  "sort-package-json": "^2.10.0",
41
41
  "tiged": "^2.12.7",
42
- "@sidekickdb/platform": "2.0.0",
43
- "@sidekickdb/cli": "2.0.0",
44
- "@sidekickdb/version": "2.0.0"
42
+ "@sidekickdb/platform": "2.0.1",
43
+ "@sidekickdb/version": "2.0.1",
44
+ "@sidekickdb/cli": "2.0.1"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@anthropic-ai/sdk": "^0.60.0",
@@ -29,6 +29,12 @@ React use Next and Tailwind unless specified otherwise.
29
29
  Look for `instant.schema.ts` and `instant.perms.ts`. These define the schema and permissions.
30
30
  Look for an app id and admin token in `.env` or another env file.
31
31
 
32
+ SidekickDB has no default server. The CLI reads the server URL from `apiURI` in
33
+ `sidekick.config.ts` or `instant.config.ts` (the first one found wins), or from
34
+ the `SIDEKICK_CLI_API_URI` environment variable, which wins over both. `login`
35
+ also needs the dashboard URL: `dashURI` in the same file, or
36
+ `SIDEKICK_CLI_DASH_URI`. If they are not set, ask the user for their URLs.
37
+
32
38
  If schema/perm files exist but the app id/admin token are missing, ask the user where to find them or whether to create a new app.
33
39
 
34
40
  To create a new app:
@@ -299,16 +305,24 @@ db.rooms.useTopicEffect(room, 'emoji', (payload) => {
299
305
 
300
306
  Always pass `schema` when initializing SidekickDB to get type safety for queries and transactions
301
307
 
308
+ If the project already calls `init` from the SDK you need (for example in
309
+ `src/lib/db.ts`), import its exported database instead of calling `init` again.
310
+
311
+ Every `init` also needs `apiURI`, the URL of the user's SidekickDB server, because
312
+ SidekickDB has no default server. Use the same `apiURI` as the project's existing
313
+ `init`, or `apiURI` in `sidekick.config.ts` or `instant.config.ts` (the first one
314
+ found wins).
315
+
302
316
  ```tsx
303
317
  import schema from '@/instant.schema';
304
318
 
305
319
  // On client
306
320
  import { init } from '@sidekickdb/react'; // or your relevant SidekickDB SDK
307
- const clientDb = init({ appId, schema });
321
+ const clientDb = init({ apiURI, appId, schema });
308
322
 
309
323
  // On backend
310
324
  import { init } from '@sidekickdb/admin';
311
- const adminDb = init({ appId, adminToken, schema });
325
+ const adminDb = init({ apiURI, appId, adminToken, schema });
312
326
  ```
313
327
 
314
328
  ## Use `id()` to generate ids