create-brainerce-store 1.53.0 → 1.55.0

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.
@@ -1,4 +1,5 @@
1
1
  import type { MetadataRoute } from 'next';
2
+ import { getBlogSitemapEntries, getCategorySitemapEntries } from 'brainerce';
2
3
  import { getServerClient } from '@/core/lib/brainerce';
3
4
 
4
5
  export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
@@ -42,7 +43,23 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
42
43
  });
43
44
  });
44
45
 
45
- return [...staticPages, ...productPages];
46
+ // Category (collection) pages — the highest-value organic-SEO surface;
47
+ // must be crawlable so they can rank for broad research-intent queries.
48
+ const categoryPages: MetadataRoute.Sitemap = await getCategorySitemapEntries(client, {
49
+ siteUrl: baseUrl,
50
+ locales: isMultiLocale ? supportedLocales : undefined,
51
+ defaultLocale: defaultLoc,
52
+ }).catch(() => []);
53
+
54
+ // Blog posts — the SEO Autopilot (and manual publishes) must be
55
+ // discoverable; missing blog entries = articles never get crawled.
56
+ const blogPages: MetadataRoute.Sitemap = await getBlogSitemapEntries(client, {
57
+ siteUrl: baseUrl,
58
+ locales: isMultiLocale ? supportedLocales : undefined,
59
+ defaultLocale: defaultLoc,
60
+ }).catch(() => []);
61
+
62
+ return [...staticPages, ...productPages, ...categoryPages, ...blogPages];
46
63
  } catch {
47
64
  return staticPages;
48
65
  }
@@ -34,6 +34,13 @@ export function BrainerceBotWidget() {
34
34
  BrainerceBot.mount({
35
35
  connectionId,
36
36
  baseUrl: process.env.NEXT_PUBLIC_BRAINERCE_API_URL || undefined,
37
+ // Order-lookup login gating: this template's own same-origin BFF proxy
38
+ // (see src/app/api/store/[...path]/route.ts) already forwards the
39
+ // shopper's httpOnly session cookie as a Bearer header — the same
40
+ // mechanism @/core/lib/brainerce's own client uses. Opting the bot in
41
+ // here lets it detect login state without the widget ever touching the
42
+ // cookie itself.
43
+ customerSessionProxyPath: '/api/store',
37
44
  onAddToCart: async ({ productId, variantId, quantity }) => {
38
45
  try {
39
46
  const { getClient } = await import('@/core/lib/brainerce');