@avsbhq/snippet-types 1.0.0 → 1.2.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.
- package/avsb.d.ts +2 -0
- package/package.json +1 -1
- package/variation-code.d.ts +1 -7
package/avsb.d.ts
CHANGED
|
@@ -398,6 +398,8 @@ interface AvsbApi {
|
|
|
398
398
|
commerce: AvsbCommerceApi
|
|
399
399
|
/** Leave a shared preview link: clears the preview token and reloads. */
|
|
400
400
|
exitPreview(): void
|
|
401
|
+
/** After a split-URL redirect in this tab: the referrer of the page the visitor was redirected FROM, captured before the redirect so your analytics can undo the self-referral. `''` means that visit was direct; `null` means no redirect has happened (or storage is unavailable). Same-origin only, so a destination on a different domain cannot read it. Optional: absent on snippet builds that predate it, so read it as `avsb.getOriginalReferrer?.()`. */
|
|
402
|
+
getOriginalReferrer?(): string | null
|
|
401
403
|
/** Re-run every experiment against the page as it is now. For app-driven navigation the History API never sees. */
|
|
402
404
|
refresh(): void
|
|
403
405
|
/** The snippet build running on this page, e.g. `1.1.0`. */
|
package/package.json
CHANGED
package/variation-code.d.ts
CHANGED
|
@@ -15,12 +15,6 @@
|
|
|
15
15
|
// Not a module, for the same reason as `avsb.d.ts`: these are global names, and
|
|
16
16
|
// an `export` would hide all of them. Frozen at launch: rename nothing, add only.
|
|
17
17
|
|
|
18
|
-
/** Recommendations client pre-bound to the running experiment and variation. */
|
|
19
|
-
interface AvsbBoundRecsClient extends AvsbRecsClient {
|
|
20
|
-
/** Resolve THIS variation's bound recipe, so one code block serves every variation. */
|
|
21
|
-
getBound(req?: Omit<AvsbRecsRequest, 'recipe'>): Promise<AvsbRecsResult>
|
|
22
|
-
}
|
|
23
|
-
|
|
24
18
|
/** What every user-code surface receives. Self-cleaning helpers are torn down for you. */
|
|
25
19
|
interface AvsbCodeOptions {
|
|
26
20
|
/** Present in variation and trigger code. */
|
|
@@ -37,7 +31,7 @@ interface AvsbCodeOptions {
|
|
|
37
31
|
onRemove(cb: () => void): void
|
|
38
32
|
track: AvsbTrackFunction
|
|
39
33
|
/** Impressions and clicks attribute to this variation automatically. */
|
|
40
|
-
recs:
|
|
34
|
+
recs: AvsbRecsClient
|
|
41
35
|
getVisitorId(): string | null
|
|
42
36
|
/** The visitor's numeric **Variation ID** in that experiment, or null. Takes the numeric **Experiment ID** from the experiment details panel, NOT the `experimentId` above (that one is the internal id). */
|
|
43
37
|
getVariation(experimentId: string | number): string | null
|