@replohq/sdk 2.20.0 → 2.20.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.
@@ -1,6 +1,5 @@
1
1
  import type { ScriptTagDescriptor } from "../_vendor/schemas/generated/consent";
2
2
  import type { ConsentCategory, ReploScriptEntry } from "./types";
3
- import { Component } from "react";
4
3
  /**
5
4
  * Injects the resolved tags into `document.head` once a caller has decided
6
5
  * consent allows it. Reused both for author-managed `ReploScripts` entries and
@@ -16,12 +15,9 @@ type InjectedScriptProps = {
16
15
  descriptors: ScriptTagDescriptor[];
17
16
  /** Used under a delegated platform to derive the attributes that gate the tag. */
18
17
  requiredConsent?: ConsentCategory[];
19
- usercentricsService?: string;
18
+ usercentricsService?: string | null;
20
19
  };
21
- export declare class InjectedScript extends Component<InjectedScriptProps> {
22
- componentDidMount(): void;
23
- render(): null;
24
- }
20
+ export declare function InjectedScript({ baseId, descriptors, requiredConsent, usercentricsService, }: InjectedScriptProps): null;
25
21
  /**
26
22
  * The single registry component for all managed tracking scripts on the site.
27
23
  * Authored once in `app/layout.tsx`; the agent/miniapp only edit the `scripts`
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
- import { Component } from "react";
3
+ import { useEffect } from "react";
4
4
  import {
5
5
  buildGrantMarker,
6
6
  enableConsentDelegation,
@@ -59,30 +59,30 @@ function descriptorsFor(entry) {
59
59
  }
60
60
  return buildScriptTags(entry);
61
61
  }
62
- class InjectedScript extends Component {
63
- componentDidMount() {
64
- const { requiredConsent = [], usercentricsService = null } = this.props;
62
+ function InjectedScript({
63
+ baseId,
64
+ descriptors,
65
+ requiredConsent = [],
66
+ usercentricsService = null
67
+ }) {
68
+ useEffect(() => {
65
69
  injectGatedScript({
66
- baseId: this.props.baseId,
67
- descriptors: this.props.descriptors,
70
+ baseId,
71
+ descriptors,
68
72
  requiredConsent,
69
73
  usercentricsService
70
74
  });
71
- }
72
- render() {
73
- return null;
74
- }
75
+ }, []);
76
+ return null;
75
77
  }
76
- class ScriptRegistration extends Component {
77
- componentDidMount() {
78
- registerScript(this.props.script);
79
- }
80
- componentWillUnmount() {
81
- unregisterScript(this.props.script.id);
82
- }
83
- render() {
84
- return null;
85
- }
78
+ function ScriptRegistration({ script }) {
79
+ useEffect(() => {
80
+ registerScript(script);
81
+ return () => {
82
+ unregisterScript(script.id);
83
+ };
84
+ }, []);
85
+ return null;
86
86
  }
87
87
  function registrationFor(entry, loaderContainerId) {
88
88
  const id = scriptId(entry);
@@ -121,23 +121,16 @@ function ManagedScript({
121
121
  baseId: id,
122
122
  descriptors: descriptorsFor(entry),
123
123
  requiredConsent,
124
- usercentricsService: usercentricsService ?? void 0
124
+ usercentricsService
125
125
  }
126
126
  )
127
127
  ] });
128
128
  }
129
- class ConsentWindowApi extends Component {
130
- uninstall = () => {
131
- };
132
- componentDidMount() {
133
- this.uninstall = installConsentWindowApi();
134
- }
135
- componentWillUnmount() {
136
- this.uninstall();
137
- }
138
- render() {
139
- return null;
140
- }
129
+ function ConsentWindowApi() {
130
+ useEffect(() => {
131
+ return installConsentWindowApi();
132
+ }, []);
133
+ return null;
141
134
  }
142
135
  function ReploScripts({ scripts }) {
143
136
  const platform = findConsentPlatform(scripts);
@@ -1,7 +1,7 @@
1
1
  export const BUILD_METADATA = {
2
2
  "packageName": "@replohq/sdk",
3
- "version": "2.20.0",
3
+ "version": "2.20.1",
4
4
  "branch": "HEAD",
5
- "commit": "20365c00f7144702c4a7438ac5d907dc97b5b62a",
6
- "builtAt": "2026-11-06T20:15:11.914Z"
5
+ "commit": "1d896e2349feb742232139686002f2e2741f01ea",
6
+ "builtAt": "2026-11-06T21:19:31.851Z"
7
7
  };
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@replohq/sdk",
3
- "version": "2.20.0",
3
+ "version": "2.20.1",
4
4
  "reploBuild": {
5
5
  "packageName": "@replohq/sdk",
6
- "version": "2.20.0",
6
+ "version": "2.20.1",
7
7
  "branch": "HEAD",
8
- "commit": "20365c00f7144702c4a7438ac5d907dc97b5b62a",
9
- "builtAt": "2026-11-06T20:15:11.914Z"
8
+ "commit": "1d896e2349feb742232139686002f2e2741f01ea",
9
+ "builtAt": "2026-11-06T21:19:31.851Z"
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",