@zuzjs/flare 0.2.13 → 0.2.15

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/README.md CHANGED
@@ -545,6 +545,38 @@ service cloud.firestore {
545
545
 
546
546
  Tip: if you set owner uid at create time, prefer checking `requestData.uid` on create and `resourceData.uid` on update/delete.
547
547
 
548
+ ## Internal Collection Aliases
549
+
550
+ The client can use public collection names for server-managed collections.
551
+ The server maps these names to internal `_flare_*` collections automatically for reads, writes, queries, subscriptions, and rules-related lookups.
552
+
553
+ Prefer the public names in SDK code:
554
+
555
+ | Public name | Internal collection |
556
+ | --- | --- |
557
+ | `users` | `_flare_auth_users` |
558
+ | `sessions` | `_flare_auth_sessions` |
559
+ | `auth_fields` | `_flare_auth_fields` |
560
+ | `email_links` | `_flare_email_links` |
561
+ | `email_outbox` | `_flare_email_outbox` |
562
+ | `email_verifications` | `_flare_email_verifications` |
563
+ | `password_recoveries` | `_flare_password_recoveries` |
564
+ | `push_tokens` | `_flare_push_tokens` |
565
+ | `push_outbox` | `_flare_push_outbox` |
566
+ | `index_suggestions` | `_flare_index_suggestions` |
567
+
568
+ Example:
569
+
570
+ ```ts
571
+ const app = connectApp({ endpoint: 'https://flare.zuzcdn.net', appId: 'my-app', apiKey: 'ak' });
572
+
573
+ const me = await app.collection('users').doc('alice').get();
574
+ const activeSessions = await app.collection('sessions').where({ uid: 'alice' }).get();
575
+ const pushTokens = await app.collection('push_tokens').where({ uid: 'alice' }).get();
576
+
577
+ console.log(me.data(), activeSessions.docs.length, pushTokens.docs.length);
578
+ ```
579
+
548
580
  Emails are sent only through app-level templates stored in `_flare_email_templates`.
549
581
 
550
582
  Template placeholders use `{key}` syntax and are replaced from `values`.