@replohq/sdk 1.10.2 → 1.11.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.
@@ -8,7 +8,7 @@ export declare function AnalyticsProvider({ children, checkoutProvider, }: React
8
8
  * Returns the AnalyticsSink from the nearest AnalyticsProvider.
9
9
  * Throws if used outside of an AnalyticsProvider.
10
10
  */
11
- export declare function useAnalytics(): AnalyticsSink | null;
11
+ export declare function useAnalytics(): AnalyticsSink;
12
12
  /**
13
13
  * Returns the AnalyticsSink if an AnalyticsProvider is present, or null otherwise.
14
14
  * Does not throw -- safe to use in components that may render with or without analytics.
@@ -9,7 +9,7 @@ function useCollectionViewedAnalytics({
9
9
  const analytics = useAnalytics();
10
10
  const lastTrackedRef = useRef(null);
11
11
  useEffect(() => {
12
- if (!analytics || !collection || !products) {
12
+ if (!collection || !products) {
13
13
  return;
14
14
  }
15
15
  if (lastTrackedRef.current === collection.id) {
@@ -8,7 +8,7 @@ function useProductViewedAnalytics({
8
8
  const analytics = useAnalytics();
9
9
  const lastTrackedRef = useRef(null);
10
10
  useEffect(() => {
11
- if (analytics && product && selectedVariant) {
11
+ if (product && selectedVariant) {
12
12
  const trackingKey = `${product.id}-${selectedVariant.id}`;
13
13
  if (lastTrackedRef.current !== trackingKey) {
14
14
  lastTrackedRef.current = trackingKey;
@@ -14,11 +14,18 @@ export type BuyNowOutcome = {
14
14
  available: number;
15
15
  }[];
16
16
  };
17
+ /**
18
+ * Describes a single variant to send directly to checkout.
19
+ */
17
20
  export interface VariantBuyNowInfo {
18
21
  variantId: string;
19
22
  quantity?: number;
20
23
  sellingPlanId?: string | null;
21
- /** Custom line item properties (appear on the order). */
24
+ /**
25
+ * Custom line item properties forwarded to checkout. Shopify persists them on the order;
26
+ * Stripe order persistence is not yet supported. Underscore-prefixed keys are hidden at
27
+ * Shopify checkout.
28
+ */
22
29
  properties?: CartLineAttribute[];
23
30
  }
24
31
  /**
@@ -47,6 +54,12 @@ export interface VariantBuyNowInfo {
47
54
  * variantId: selectedVariant.id,
48
55
  * quantity,
49
56
  * sellingPlanId: selectedSellingPlan?.id,
57
+ * properties: [
58
+ * {
59
+ * key: "Pre-order item",
60
+ * value: "Shipping between Aug 20 - Aug 27",
61
+ * },
62
+ * ],
50
63
  * },
51
64
  * ],
52
65
  * { discountCodes: ["SUMMER2024"] }
@@ -1,7 +1,7 @@
1
1
  export const BUILD_METADATA = {
2
2
  "packageName": "@replohq/sdk",
3
- "version": "1.10.2",
3
+ "version": "1.11.1",
4
4
  "branch": "HEAD",
5
- "commit": "5ee9af27c9ec5545655f225b5029ef7572f61344",
6
- "builtAt": "2026-09-20T21:55:46.106Z"
5
+ "commit": "2fa39d32578073f6dfa2ad2d093a726cdedeb108",
6
+ "builtAt": "2026-09-21T18:23:00.156Z"
7
7
  };
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@replohq/sdk",
3
- "version": "1.10.2",
3
+ "version": "1.11.1",
4
4
  "reploBuild": {
5
5
  "packageName": "@replohq/sdk",
6
- "version": "1.10.2",
6
+ "version": "1.11.1",
7
7
  "branch": "HEAD",
8
- "commit": "5ee9af27c9ec5545655f225b5029ef7572f61344",
9
- "builtAt": "2026-09-20T21:55:46.106Z"
8
+ "commit": "2fa39d32578073f6dfa2ad2d093a726cdedeb108",
9
+ "builtAt": "2026-09-21T18:23:00.156Z"
10
10
  },
11
11
  "description": "Replo SDK — cart, analytics, and data loaders for agent-built Next.js sites.",
12
12
  "license": "SEE LICENSE IN LICENSE",