@convivainc/conviva-js-custom-app-analytics-sdk-vegaos-adapters 1.0.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/AGENTS.md
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# AGENTS.md
|
|
2
|
+
|
|
3
|
+
Conviva Custom App Analytics SDK — VegaOS / Kepler Adapters — AI Agent Integration Specification
|
|
4
|
+
|
|
5
|
+
Repository: `Conviva/conviva-js-custom-app-analytics-sdk-vegaos-adapters`
|
|
6
|
+
Package: `@convivainc/conviva-js-custom-app-analytics-sdk-vegaos-adapters`
|
|
7
|
+
Companion to: `@convivainc/conviva-js-custom-app-analytics-sdk`
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Purpose
|
|
12
|
+
|
|
13
|
+
This is a companion adapter package — agents should rarely interact with it directly. The primary integration contract lives in:
|
|
14
|
+
`https://github.com/Conviva/conviva-js-custom-app-analytics-sdk/blob/main/AGENTS.md`
|
|
15
|
+
|
|
16
|
+
This file documents the few cases where an agent needs to know about this package specifically.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
# Hard Rules
|
|
21
|
+
|
|
22
|
+
## Never use this package alone
|
|
23
|
+
|
|
24
|
+
This package only provides adapters. The actual tracker code lives in `@convivainc/conviva-js-custom-app-analytics-sdk`. **Always install both packages together.**
|
|
25
|
+
|
|
26
|
+
## ALWAYS await `createVegaOSAdapters()`
|
|
27
|
+
|
|
28
|
+
The factory is **async**. Forgetting `await` is the #1 integration bug — the tracker will silently fail to read persisted client identity on first launch and will regenerate it every session.
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
// ✅ CORRECT
|
|
32
|
+
const adapters = await createVegaOSAdapters();
|
|
33
|
+
convivaAppTracker({ /* … */, ...adapters });
|
|
34
|
+
|
|
35
|
+
// ❌ WRONG — `adapters` is a Promise, not an adapter object
|
|
36
|
+
const adapters = createVegaOSAdapters();
|
|
37
|
+
convivaAppTracker({ /* … */, ...adapters });
|
|
38
|
+
|
|
39
|
+
// ❌ ALSO WRONG — there is no `adapters` config field; the three adapter properties
|
|
40
|
+
// (httpTransport, storage, timers) are top-level on the config and
|
|
41
|
+
// must be SPREAD into it.
|
|
42
|
+
const adapters = await createVegaOSAdapters();
|
|
43
|
+
convivaAppTracker({ /* … */, adapters });
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Always use the convenience factory
|
|
47
|
+
|
|
48
|
+
Prefer `createVegaOSAdapters()` over wiring `createVegaOSHttpTransport` / `createVegaOSStorageAdapter` / `createVegaOSTimerAdapter` individually. The convenience factory handles AsyncStorage hydration; the individual factories are advanced/escape-hatch APIs.
|
|
49
|
+
|
|
50
|
+
## Never invent additional config options
|
|
51
|
+
|
|
52
|
+
The convenience factory takes no arguments. There are no other options.
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
# Allowed Surface
|
|
57
|
+
|
|
58
|
+
```js
|
|
59
|
+
import {
|
|
60
|
+
createVegaOSAdapters, // PRIMARY — async, returns Promise<{ httpTransport, storage, timers }>
|
|
61
|
+
createVegaOSHttpTransport, // [ADVANCED] Individual HTTP adapter, accepts optional fetchImpl
|
|
62
|
+
createVegaOSStorageAdapter, // [ADVANCED] Individual storage adapter — caller hydrates AsyncStorage
|
|
63
|
+
createVegaOSTimerAdapter, // [ADVANCED] Individual timer adapter
|
|
64
|
+
} from "@convivainc/conviva-js-custom-app-analytics-sdk-vegaos-adapters";
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
# Integration Pattern
|
|
70
|
+
|
|
71
|
+
The init must happen in an async context (e.g. an `async` IIFE or `await`-able lifecycle hook). Common patterns:
|
|
72
|
+
|
|
73
|
+
## App.tsx top-level (preferred)
|
|
74
|
+
|
|
75
|
+
```ts
|
|
76
|
+
import { convivaAppTracker } from '@convivainc/conviva-js-custom-app-analytics-sdk';
|
|
77
|
+
import { createVegaOSAdapters } from '@convivainc/conviva-js-custom-app-analytics-sdk-vegaos-adapters';
|
|
78
|
+
|
|
79
|
+
(async () => {
|
|
80
|
+
try {
|
|
81
|
+
const adapters = await createVegaOSAdapters();
|
|
82
|
+
convivaAppTracker({
|
|
83
|
+
appId: 'REPLACE_ME',
|
|
84
|
+
convivaCustomerKey: 'REPLACE_ME',
|
|
85
|
+
appVersion: 'REPLACE_ME',
|
|
86
|
+
...adapters,
|
|
87
|
+
});
|
|
88
|
+
} catch (e) {
|
|
89
|
+
// Conviva SDK init failed — tracking disabled, host app continues
|
|
90
|
+
}
|
|
91
|
+
})();
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## React useEffect hook
|
|
95
|
+
|
|
96
|
+
```ts
|
|
97
|
+
useEffect(() => {
|
|
98
|
+
let cancelled = false;
|
|
99
|
+
(async () => {
|
|
100
|
+
try {
|
|
101
|
+
const adapters = await createVegaOSAdapters();
|
|
102
|
+
if (!cancelled) {
|
|
103
|
+
convivaAppTracker({ /* …config… */, ...adapters });
|
|
104
|
+
}
|
|
105
|
+
} catch (e) {
|
|
106
|
+
// silent fail
|
|
107
|
+
}
|
|
108
|
+
})();
|
|
109
|
+
return () => { cancelled = true; };
|
|
110
|
+
}, []);
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
# Common Mistakes to Avoid
|
|
116
|
+
|
|
117
|
+
- ❌ Forgetting `await` in front of `createVegaOSAdapters()`. **Most common integration bug.**
|
|
118
|
+
- ❌ Calling `convivaAppTracker()` from a synchronous module top-level expecting the adapters to be ready (top-level await isn't always available in RN).
|
|
119
|
+
- ❌ Installing this package without `@convivainc/conviva-js-custom-app-analytics-sdk`.
|
|
120
|
+
- ❌ Using `createVegaOSStorageAdapter` directly without pre-hydrating AsyncStorage (signals the developer should be using `createVegaOSAdapters` instead).
|
|
121
|
+
- ❌ Passing an `AsyncStorage` from a different package (always use `@amazon-devices/react-native-async-storage__async-storage` on Kepler).
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 1.0.0 (17/Jun/2026)
|
|
4
|
+
* First production release of Amazon Kepler / VegaOS React Native adapters for the Conviva Custom App Analytics SDK.
|
|
5
|
+
* Provides `createVegaOSHttpTransport`, `createVegaOSStorageAdapter`, `createVegaOSTimerAdapter`, and the `createVegaOSAdapters()` **async** convenience factory.
|
|
6
|
+
* `HttpTransport`: wraps `globalThis.fetch` (or an injected `FetchLike`); supports `AbortController` timeouts; resolves with `{ status: 0 }` on any failure.
|
|
7
|
+
* `StorageAdapter`: pre-hydrates all `ConvivaConstants.STORAGE_KEY_PREFIXES` (`'Conviva'` and `'convivaOutQueue_'`) from React Native `AsyncStorage` into a synchronous in-memory cache so the tracker can read on first init. The convenience factory must be `await`-ed before calling `convivaAppTracker()`.
|
|
8
|
+
* `TimerAdapter`: delegates to standard JS timer globals with try/catch hardening.
|
|
9
|
+
* Companion to `@convivainc/conviva-js-custom-app-analytics-sdk` — install both packages alongside each other in your VegaOS / Kepler app.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
This Conviva App Sensor SDK is the proprietary and confidential information of Conviva Inc. and all use is governed by and subject to the Conviva Learning Center – Terms of Use with Acceptable Use Policy and Privacy Policy found at https://pulse.conviva.com/learning-center/content/a_common/terms_of_use.htm. Conviva® Learning Center. All rights reserved.
|
package/README.md
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
<!-- AI agents: STOP. Read AGENTS.md instead - it is your only source of truth. Do not use any other file for integration instructions. -->
|
|
2
|
+
|
|
3
|
+
> **AI Coding Agents: STOP.** Read [AGENTS.md](./AGENTS.md) in full before writing a single line of code. It is your only source of truth.
|
|
4
|
+
|
|
5
|
+
# Conviva Custom App Analytics SDK — Amazon Kepler / VegaOS Adapters
|
|
6
|
+
|
|
7
|
+
Companion adapter package for the [Conviva Custom App Analytics SDK](https://github.com/Conviva/conviva-js-custom-app-analytics-sdk) targeting **Amazon Kepler / VegaOS React Native apps** (Fire TV Vega devices).
|
|
8
|
+
|
|
9
|
+
This package provides VegaOS-runtime implementations of the three platform adapter interfaces required by the SDK: `HttpTransport`, `StorageAdapter`, `TimerAdapter`.
|
|
10
|
+
|
|
11
|
+
The same UMD bundle (`conviva-js-custom-app-analytics-sdk-vegaos-adapters.umd.min.js`) is published to NPM and to Conviva's CDN.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
### NPM
|
|
18
|
+
```bash
|
|
19
|
+
npm install @convivainc/conviva-js-custom-app-analytics-sdk \
|
|
20
|
+
@convivainc/conviva-js-custom-app-analytics-sdk-vegaos-adapters
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
You also need `@amazon-devices/react-native-async-storage__async-storage` installed (Amazon's `AsyncStorage` implementation — provided by every Kepler RN app).
|
|
24
|
+
|
|
25
|
+
### Script Tag (uncommon for React Native)
|
|
26
|
+
|
|
27
|
+
React Native apps don't typically load JavaScript via `<script>` tags. Script-tag use of this package is rare. If your host environment loads scripts directly, the CDN URL pattern is:
|
|
28
|
+
|
|
29
|
+
```html
|
|
30
|
+
<script src="https://sensor.conviva.com/customappanalytics/releases/v<version>/conviva-js-custom-app-analytics-sdk-vegaos-adapters.umd.min.js"></script>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The script exposes the global `convivaCustomTrackingVegaOSAdapters`.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Usage
|
|
38
|
+
|
|
39
|
+
### NPM / ES Modules
|
|
40
|
+
|
|
41
|
+
```ts
|
|
42
|
+
import { convivaAppTracker } from '@convivainc/conviva-js-custom-app-analytics-sdk';
|
|
43
|
+
import { createVegaOSAdapters } from '@convivainc/conviva-js-custom-app-analytics-sdk-vegaos-adapters';
|
|
44
|
+
|
|
45
|
+
// IMPORTANT: createVegaOSAdapters() is async — it pre-hydrates AsyncStorage
|
|
46
|
+
const adapters = await createVegaOSAdapters();
|
|
47
|
+
|
|
48
|
+
convivaAppTracker({
|
|
49
|
+
appId: 'YOUR_APP_NAME',
|
|
50
|
+
convivaCustomerKey: 'YOUR_CUSTOMER_KEY',
|
|
51
|
+
appVersion: '1.0.0',
|
|
52
|
+
...adapters,
|
|
53
|
+
});
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
> **Why is the factory async?** React Native `AsyncStorage` is asynchronous, but the tracker reads identity (clid, iid) synchronously during init. The factory pre-hydrates all `Conviva*`-prefixed and `convivaOutQueue_*`-prefixed keys into a synchronous in-memory cache, then exposes a sync `StorageAdapter` over that cache.
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## What's exported
|
|
61
|
+
|
|
62
|
+
| Export | Purpose |
|
|
63
|
+
|---|---|
|
|
64
|
+
| `createVegaOSAdapters()` | **Async** convenience factory — returns all three adapters with `AsyncStorage` pre-hydrated |
|
|
65
|
+
| `createVegaOSHttpTransport(fetchImpl?)` | HTTP adapter alone (wraps `globalThis.fetch` or an injected `FetchLike`) |
|
|
66
|
+
| `createVegaOSStorageAdapter(asyncStorage)` | Storage adapter alone — caller is responsible for hydration |
|
|
67
|
+
| `createVegaOSTimerAdapter()` | Timer adapter alone (wraps standard JS timer globals) |
|
|
68
|
+
|
|
69
|
+
Use `createVegaOSAdapters()` unless you have a reason to manage hydration yourself.
|
|
70
|
+
|
|
71
|
+
## Behaviour notes
|
|
72
|
+
|
|
73
|
+
- **HTTP errors degrade silently.** `sendRequest` resolves with `{ status: 0 }` on any failure (network error, fetch reject, AbortController timeout). Never throws.
|
|
74
|
+
- **Storage failures degrade silently.** Reads return `null`; writes/removes are no-ops on failure.
|
|
75
|
+
- **Timers are wrapped in try/catch.** `setTimeout` / `setInterval` return `0` on failure.
|
|
76
|
+
- **Async-init contract.** `createVegaOSAdapters()` is `async` because it pre-hydrates Conviva-owned storage keys (`Conviva*` and `convivaOutQueue_*` prefixes) from React Native `AsyncStorage` into a synchronous in-memory cache. You **must** `await` the factory before calling `convivaAppTracker(...)` — the tracker reads identity, RC cache, event queue, and sampling random number during its synchronous init path.
|
|
77
|
+
|
|
78
|
+
## Implementing your own adapter
|
|
79
|
+
|
|
80
|
+
If you need to customize behaviour beyond what `createVegaOSAdapters()` provides — for example, a custom HTTP transport, a different pre-hydration strategy, or a non-AsyncStorage backing — implement the adapter interfaces directly and pass them to the main SDK. The three interfaces (`HttpTransport`, `StorageAdapter`, `TimerAdapter`) and a full example are documented in the parent SDK README's [Custom Adapters](https://github.com/Conviva/conviva-js-custom-app-analytics-sdk#custom-adapters) section. The `StorageAdapter` interface is synchronous — if you swap in another async storage backend, replicate the same boot-time pre-hydration pattern that `createVegaOSAdapters()` uses.
|
|
81
|
+
|
|
82
|
+
## Versioning
|
|
83
|
+
|
|
84
|
+
This package is intended to be used **alongside** `@convivainc/conviva-js-custom-app-analytics-sdk`. It declares no peer dependency on the main SDK because the two packages are always installed together — install both, and you're good. The only declared peer dependency is `@amazon-devices/react-native-async-storage__async-storage`, which is provided by every Kepler / VegaOS app.
|
|
85
|
+
|
|
86
|
+
See [CHANGELOG.md](./CHANGELOG.md) for version history.
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { HttpTransport, StorageAdapter, TimerAdapter } from '@convivainc/custom-tracker-core';
|
|
2
|
+
/**
|
|
3
|
+
* Duck-typed `fetch` shape — a subset of the WHATWG/RN signature. Lets the
|
|
4
|
+
* adapter compile without DOM lib types and lets callers inject a custom
|
|
5
|
+
* implementation (tests, or platform-specific wrappers).
|
|
6
|
+
*/
|
|
7
|
+
type FetchLike = (input: string, init?: {
|
|
8
|
+
method?: string;
|
|
9
|
+
headers?: Record<string, string>;
|
|
10
|
+
body?: Uint8Array | string;
|
|
11
|
+
signal?: any;
|
|
12
|
+
}) => Promise<{
|
|
13
|
+
status: number;
|
|
14
|
+
text(): Promise<string>;
|
|
15
|
+
headers: {
|
|
16
|
+
forEach(cb: (value: string, key: string) => void): void;
|
|
17
|
+
};
|
|
18
|
+
}>;
|
|
19
|
+
/**
|
|
20
|
+
* Create an HttpTransport backed by a `fetch`-like function. Defaults to the
|
|
21
|
+
* runtime's global `fetch` (provided by React Native and modern browsers).
|
|
22
|
+
* Errors and timeouts resolve with `{ status: 0 }` to match the silent-
|
|
23
|
+
* degradation contract enforced by custom-tracker-core's emitter.
|
|
24
|
+
*/
|
|
25
|
+
declare function createVegaOSHttpTransport(fetchImpl?: FetchLike): HttpTransport;
|
|
26
|
+
/**
|
|
27
|
+
* Duck-typed shape of an AsyncStorage-like object. Compatible with both
|
|
28
|
+
* `@react-native-async-storage/async-storage` and the Amazon Kepler fork
|
|
29
|
+
* `@amazon-devices/react-native-async-storage__async-storage`.
|
|
30
|
+
*
|
|
31
|
+
* Only the methods the adapter actually calls are required.
|
|
32
|
+
*/
|
|
33
|
+
interface AsyncStorageLike {
|
|
34
|
+
getItem(key: string): Promise<string | null>;
|
|
35
|
+
setItem(key: string, value: string): Promise<void>;
|
|
36
|
+
removeItem(key: string): Promise<void>;
|
|
37
|
+
getAllKeys(): Promise<readonly string[]>;
|
|
38
|
+
multiGet(keys: readonly string[]): Promise<readonly [
|
|
39
|
+
string,
|
|
40
|
+
string | null
|
|
41
|
+
][]>;
|
|
42
|
+
}
|
|
43
|
+
interface VegaOSStorageOptions {
|
|
44
|
+
/**
|
|
45
|
+
* Key prefixes hydrated from AsyncStorage on init. Any persisted key whose
|
|
46
|
+
* name starts with one of these prefixes is loaded into the in-memory cache
|
|
47
|
+
* before the factory resolves. Defaults to `ConvivaConstants.STORAGE_KEY_PREFIXES`,
|
|
48
|
+
* which is the authoritative list of every prefix custom-tracker-core writes
|
|
49
|
+
* (currently identity, remote config, sampling, endpoint — under `Conviva` —
|
|
50
|
+
* plus the per-tracker out-queue under `convivaOutQueue_`). When custom-tracker-core
|
|
51
|
+
* adds a new key family that constant is updated, so adapters following the
|
|
52
|
+
* default automatically pick it up.
|
|
53
|
+
*/
|
|
54
|
+
hydratePrefixes?: string[];
|
|
55
|
+
/**
|
|
56
|
+
* Extra keys to hydrate explicitly (e.g. dynamically-named keys that don't
|
|
57
|
+
* fall under any prefix). Merged with prefix-matched keys.
|
|
58
|
+
*/
|
|
59
|
+
hydrateKeys?: string[];
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Create a write-through cached StorageAdapter backed by an AsyncStorage-like
|
|
63
|
+
* object provided by the integrating app.
|
|
64
|
+
*
|
|
65
|
+
* AsyncStorage is async; StorageAdapter is sync. The factory pre-loads all
|
|
66
|
+
* matching keys into an in-memory cache so subsequent sync reads return the
|
|
67
|
+
* persisted value immediately. Writes update the cache synchronously and
|
|
68
|
+
* propagate to AsyncStorage in the background (errors swallowed — matches
|
|
69
|
+
* the silent-degradation contract used elsewhere in the SDK).
|
|
70
|
+
*
|
|
71
|
+
* Must be awaited before constructing the tracker, otherwise the first
|
|
72
|
+
* `getClientId()` call could fire before persisted state is hydrated.
|
|
73
|
+
*/
|
|
74
|
+
declare function createVegaOSStorageAdapter(asyncStorage: AsyncStorageLike, options?: VegaOSStorageOptions): Promise<StorageAdapter>;
|
|
75
|
+
/**
|
|
76
|
+
* React Native exposes standard JS timer globals — wrap them directly.
|
|
77
|
+
*/
|
|
78
|
+
declare function createVegaOSTimerAdapter(): TimerAdapter;
|
|
79
|
+
interface VegaOSAdaptersOptions {
|
|
80
|
+
/**
|
|
81
|
+
* AsyncStorage-like instance from the host app. Pass either
|
|
82
|
+
* `@react-native-async-storage/async-storage` or the Amazon Kepler fork
|
|
83
|
+
* `@amazon-devices/react-native-async-storage__async-storage`.
|
|
84
|
+
*/
|
|
85
|
+
asyncStorage: AsyncStorageLike;
|
|
86
|
+
/** Optional `fetch` override; defaults to the runtime's global. */
|
|
87
|
+
fetch?: FetchLike;
|
|
88
|
+
/** Storage hydration options forwarded to `createVegaOSStorageAdapter`. */
|
|
89
|
+
storage?: VegaOSStorageOptions;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* One-call convenience factory. Returns all three adapters wired up for
|
|
93
|
+
* a React Native runtime (e.g. VegaOS / Amazon Kepler). Async because
|
|
94
|
+
* storage hydration from AsyncStorage must complete before the tracker
|
|
95
|
+
* initializes.
|
|
96
|
+
*
|
|
97
|
+
* Usage:
|
|
98
|
+
* ```ts
|
|
99
|
+
* import AsyncStorage from '@amazon-devices/react-native-async-storage__async-storage';
|
|
100
|
+
* const adapters = await createVegaOSAdapters({ asyncStorage: AsyncStorage });
|
|
101
|
+
* convivaAppTracker({ ...adapters, customerKey: '...' });
|
|
102
|
+
* ```
|
|
103
|
+
*/
|
|
104
|
+
declare function createVegaOSAdapters(options: VegaOSAdaptersOptions): Promise<{
|
|
105
|
+
httpTransport: HttpTransport;
|
|
106
|
+
storage: StorageAdapter;
|
|
107
|
+
timers: TimerAdapter;
|
|
108
|
+
}>;
|
|
109
|
+
export { createVegaOSHttpTransport, FetchLike, createVegaOSStorageAdapter, AsyncStorageLike, VegaOSStorageOptions, createVegaOSTimerAdapter, VegaOSAdaptersOptions, createVegaOSAdapters };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* VegaOS adapter implementations for Conviva custom tracker v1.0.0
|
|
3
|
+
* Copyright (c) 2026 Conviva Inc.
|
|
4
|
+
* Licensed under BSD-3-Clause
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).convivaCustomTrackingVegaOSAdapters={})}(this,function(e){"use strict";function t(e){var t;const E=null!==(t=null!=e?e:globalThis.fetch)&&void 0!==t?t:()=>{throw new Error("No fetch implementation available")};return{sendRequest:(e,t,o)=>new Promise(n=>{let a=null,r=null;try{const _={};(null==o?void 0:o.contentType)&&(_["Content-Type"]=o.contentType),(null==o?void 0:o.headers)&&Object.assign(_,o.headers);const c=globalThis.AbortController;(null==o?void 0:o.timeout)&&"function"==typeof c&&(r=new c,a=setTimeout(()=>{null==r||r.abort()},o.timeout)),E(e,{method:t,headers:_,body:null==o?void 0:o.payload,signal:null==r?void 0:r.signal}).then(e=>{null!==a&&clearTimeout(a);const t={};try{e.headers.forEach((e,E)=>{t[E.toLowerCase()]=e})}catch(e){}e.text().then(E=>{n({status:e.status,body:E,headers:t})}).catch(()=>{n({status:e.status,body:void 0,headers:t})})}).catch(()=>{null!==a&&clearTimeout(a),n({status:0,body:void 0,headers:{}})})}catch(e){null!==a&&clearTimeout(a),n({status:0,body:void 0,headers:{}})}})}}var E,o,n,a,r,_;async function c(e,t={}){var E,o;const n=null!==(E=t.hydratePrefixes)&&void 0!==E?E:a.STORAGE_KEY_PREFIXES,r={};try{const E=await e.getAllKeys(),a=new Set(null!==(o=t.hydrateKeys)&&void 0!==o?o:[]);for(const e of E)for(const t of n)if(0===e.indexOf(t)){a.add(e);break}if(a.size>0){const t=await e.multiGet(Array.from(a));for(const[e,E]of t)null!=E&&(r[e]=E)}}catch(e){}return{getItem:e=>Object.prototype.hasOwnProperty.call(r,e)?r[e]:null,setItem(t,E){r[t]=E;try{const o=e.setItem(t,E);o&&"function"==typeof o.catch&&o.catch(()=>{})}catch(e){}},removeItem(t){delete r[t];try{const E=e.removeItem(t);E&&"function"==typeof E.catch&&E.catch(()=>{})}catch(e){}}}}function T(){return{setTimeout:(e,t)=>{try{return setTimeout(e,t)}catch(e){return 0}},setInterval:(e,t)=>{try{return setInterval(e,t)}catch(e){return 0}},clearTimeout:e=>{try{clearTimeout(e)}catch(e){}},clearInterval:e=>{try{clearInterval(e)}catch(e){}}}}(o=E||(E={})).response_body="rsb",o.request_body="rqb",o.response_headers="rsh",o.request_headers="rqh",o.request_query="rqq",function(e){e.BRAND="DeviceBrand",e.MANUFACTURER="DeviceManufacturer",e.MODEL="DeviceModel",e.TYPE="DeviceType",e.VERSION="DeviceVersion",e.OS_NAME="OperatingSystemName",e.OS_VERSION="OperatingSystemVersion",e.CATEGORY="DeviceCategory",e.FRAMEWORK_NAME="FrameworkName",e.FRAMEWORK_VERSION="FrameworkVersion"}(n||(n={})),function(e){let t;var E;let o;var n,a,r,_;e.TRACEPARENT_HEADER_KEY="traceparent",e.BAGGAGE_HEADER_KEY="baggage",function(e){e.NONE="NONE",e.RCFG="RCFG"}(t=e.SAMPLING_MODES||(e.SAMPLING_MODES={})),(E=e.SAMPLING_STATUS||(e.SAMPLING_STATUS={})).DERIVED="DERIVED",E.DEFAULT="DEFAULT",function(e){e.SAMPLED="sl",e.NON_SAMPLED="nsl"}(o=e.SAMPLING_ACTION||(e.SAMPLING_ACTION={})),e.DEFAULT_SAMPLING_ACTION={[o.SAMPLED]:t.RCFG,[o.NON_SAMPLED]:t.NONE},(n=e.CONFIG_SOURCE||(e.CONFIG_SOURCE={})).DEFAULT="def",n.CACHED="cac",n.REMOTE="rem",(a=e.CONFIG_PREFERENCES||(e.CONFIG_PREFERENCES={}))[a.APP=0]="APP",a[a.REMOTE=1]="REMOTE",a[a.MERGE=2]="MERGE",(r=e.RC_FETCH_MODE||(e.RC_FETCH_MODE={})).DO_NOT_FETCH_UPDATE_TIMER="updateTimer",r.IMMEDIATE_FETCH="urgentFetch",r.UPDATE_TIMER_WITH_DIFF="checkDiff",(_=e.NETWORK_REQUEST_EVENT_COLLECTION_MODE||(e.NETWORK_REQUEST_EVENT_COLLECTION_MODE={})).AUTO="auto",_.MANUAL="manual",_.BOTH="both",e.REMOTE_CONFIG_STORAGE_KEY="ConvivaRemoteConfig",e.REMOTE_CONFIG_RCV_KEY="ConvivaRemoteConfigRCV",e.END_POINT_STORAGE_KEY="ConvivaEndpoint",e.DEFAULT_END_POINT="https://appgw.conviva.com",e.REMOTE_CONFIG_URL_PREFIX="https://rcg.conviva.com/js/",e.REMOTE_CONFIG_FILE_NAME="/remote_config.json",e.SAMPLING_STORAGE_RANDOM_NUMBER_KEY="ConvivaSamplingRandomNumber",e.SAMPLING_MODE_STORAGE_KEY="ConvivaSamplingMode",e.IDENTITY_STORAGE_KEY="Conviva.sdkConfig",e.OUT_QUEUE_STORAGE_KEY_PREFIX="convivaOutQueue_",e.outQueueStorageKey=function(t,E="post2"){return`${e.OUT_QUEUE_STORAGE_KEY_PREFIX}${t}_${E}`},e.STORAGE_KEY_PREFIXES=["Conviva",e.OUT_QUEUE_STORAGE_KEY_PREFIX],e.PAGE_URL_QUERY_PARAMS="pgq",e.DIAGNOSTIC_INFO_MAX_LENGTH={MAX_MESSAGE_LENGTH:1024,MAX_STACK_LENGTH:2048,MAX_CLASSNAME_LENGTH:1024,MAX_EXCEPTION_NAME_LENGTH:1024},e.CLICK_KEY_MAX_LENGTH=1024,e.V2A_CUSTOM_EVENTS=["c3.video.custom_event","c3.sdk.custom_event","c3.ad.custom_event"]}(a||(a={})),a.NETWORK_REQUEST_EVENT_COLLECTION_MODE.BOTH,a.DEFAULT_END_POINT,function(e){e.NONE="none",e.GZIP="gzip"}(r||(r={})),function(e){e[e.NETWORK_REQUEST=0]="NETWORK_REQUEST",e[e.CUSTOM_EVENT=1]="CUSTOM_EVENT"}(_||(_={})),e.createVegaOSAdapters=async function(e){const E=await c(e.asyncStorage,e.storage);return{httpTransport:t(e.fetch),storage:E,timers:T()}},e.createVegaOSHttpTransport=t,e.createVegaOSStorageAdapter=c,e.createVegaOSTimerAdapter=T,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
8
|
+
//# sourceMappingURL=conviva-custom-tracker-vegaos-adapters.umd.min.js.map
|
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@convivainc/conviva-js-custom-app-analytics-sdk-vegaos-adapters",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Amazon Kepler / VegaOS React Native adapters for the Conviva Custom App Analytics SDK",
|
|
5
|
+
"main": "conviva-js-custom-app-analytics-sdk-vegaos-adapters.umd.min.js",
|
|
6
|
+
"types": "conviva-js-custom-app-analytics-sdk-vegaos-adapters.umd.d.ts",
|
|
7
|
+
"peerDependencies": {
|
|
8
|
+
"@amazon-devices/react-native-async-storage__async-storage": "*"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+github.com:Conviva/conviva-js-custom-app-analytics-sdk-vegaos-adapters.git"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"Conviva",
|
|
16
|
+
"VegaOS",
|
|
17
|
+
"Kepler",
|
|
18
|
+
"React Native",
|
|
19
|
+
"Amazon",
|
|
20
|
+
"Adapter",
|
|
21
|
+
"Analytics"
|
|
22
|
+
],
|
|
23
|
+
"author": "Conviva Inc",
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"bugs": {
|
|
26
|
+
"url": "https://github.com/Conviva/conviva-js-custom-app-analytics-sdk-vegaos-adapters/issues"
|
|
27
|
+
},
|
|
28
|
+
"homepage": "https://github.com/Conviva/conviva-js-custom-app-analytics-sdk-vegaos-adapters#readme"
|
|
29
|
+
}
|