crowdplaysdk 0.5.0 → 0.5.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,8 +1,9 @@
1
1
  /**
2
2
  * Drop-in consent screen. Shows CrowdPlay's locked consent wording (fetched from
3
- * the native SDK so it can never drift from what the manifest records), a
4
- * switch, and a continue button that only enables once the participant
5
- * agrees. Yields the ConsentGrant that join() requires.
3
+ * the native SDK so it can never drift from what the manifest records), a link
4
+ * to the full CrowdPlay Terms of Use and Privacy Notice, a switch, and a
5
+ * continue button that only enables once the participant agrees. Yields the
6
+ * ConsentGrant that join() requires.
6
7
  *
7
8
  * <CrowdPlayConsentScreen onConsent={(grant) => joinWith(grant)} />
8
9
  *
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  /**
3
3
  * Drop-in consent screen. Shows CrowdPlay's locked consent wording (fetched from
4
- * the native SDK so it can never drift from what the manifest records), a
5
- * switch, and a continue button that only enables once the participant
6
- * agrees. Yields the ConsentGrant that join() requires.
4
+ * the native SDK so it can never drift from what the manifest records), a link
5
+ * to the full CrowdPlay Terms of Use and Privacy Notice, a switch, and a
6
+ * continue button that only enables once the participant agrees. Yields the
7
+ * ConsentGrant that join() requires.
7
8
  *
8
9
  * <CrowdPlayConsentScreen onConsent={(grant) => joinWith(grant)} />
9
10
  *
@@ -44,14 +45,11 @@ var __importStar = (this && this.__importStar) || (function () {
44
45
  return result;
45
46
  };
46
47
  })();
47
- var __importDefault = (this && this.__importDefault) || function (mod) {
48
- return (mod && mod.__esModule) ? mod : { "default": mod };
49
- };
50
48
  Object.defineProperty(exports, "__esModule", { value: true });
51
49
  exports.CrowdPlayConsentScreen = CrowdPlayConsentScreen;
52
50
  const react_1 = __importStar(require("react"));
53
51
  const react_native_1 = require("react-native");
54
- const index_1 = __importDefault(require("./index"));
52
+ const index_1 = __importStar(require("./index"));
55
53
  function CrowdPlayConsentScreen({ onConsent, style }) {
56
54
  const [text, setText] = (0, react_1.useState)(null);
57
55
  const [agreed, setAgreed] = (0, react_1.useState)(false);
@@ -74,12 +72,15 @@ function CrowdPlayConsentScreen({ onConsent, style }) {
74
72
  return (<react_native_1.View style={[styles.container, style]}>
75
73
  <react_native_1.Text style={styles.title}>Recording consent</react_native_1.Text>
76
74
  {text === null ? (<react_native_1.ActivityIndicator />) : (<react_native_1.Text style={styles.body}>{text}</react_native_1.Text>)}
75
+ <react_native_1.Pressable accessibilityRole="link" onPress={() => void react_native_1.Linking.openURL(index_1.CROWDPLAY_TERMS_URL)}>
76
+ <react_native_1.Text style={styles.link}>Read the Terms of Use and Privacy Notice</react_native_1.Text>
77
+ </react_native_1.Pressable>
77
78
  <react_native_1.View style={styles.row}>
78
79
  <react_native_1.Switch value={agreed} onValueChange={(value) => {
79
80
  setAgreed(value);
80
81
  setAgreedAtMs(value ? Date.now() : null);
81
82
  }}/>
82
- <react_native_1.Text style={styles.agree}>I agree</react_native_1.Text>
83
+ <react_native_1.Text style={styles.agree}>I have read and agree to the CrowdPlay Terms of Use and Privacy Notice.</react_native_1.Text>
83
84
  </react_native_1.View>
84
85
  <react_native_1.Text style={styles.note}>
85
86
  Recording starts automatically when you join, and ends when you leave.
@@ -105,7 +106,8 @@ const styles = react_native_1.StyleSheet.create({
105
106
  title: { fontSize: 20, fontWeight: '700', color: '#111111' },
106
107
  body: { fontSize: 15, lineHeight: 21, color: '#222222' },
107
108
  row: { flexDirection: 'row', alignItems: 'center', gap: 10 },
108
- agree: { fontSize: 15, color: '#111111' },
109
+ agree: { flex: 1, fontSize: 15, color: '#111111' },
110
+ link: { fontSize: 15, color: '#1f6feb', textDecorationLine: 'underline' },
109
111
  note: { fontSize: 12, color: '#666666' },
110
112
  button: { backgroundColor: '#1f6feb', borderRadius: 8, paddingVertical: 12, alignItems: 'center' },
111
113
  buttonDisabled: { opacity: 0.4 },
package/lib/index.d.ts CHANGED
@@ -59,6 +59,9 @@ export interface CrowdPlayConfig {
59
59
  otherAudio?: 'interrupt' | 'mix' | 'mixDucked';
60
60
  callQuality?: CallQuality;
61
61
  }
62
+ /** The CrowdPlay Terms of Use and Privacy Notice every participant accepts,
63
+ * as a PDF. CrowdPlayConsentScreen links here; a custom consent UI must too. */
64
+ export declare const CROWDPLAY_TERMS_URL = "https://dashboard.crowdplay.ai/legal/terms.pdf";
62
65
  /** Proof the participant agreed. Produce it with CrowdPlayConsentScreen, or,
63
66
  * if you render your own consent UI, call CrowdPlay.consentText() to show the
64
67
  * REQUIRED wording and construct the grant at the moment of agreement. */
package/lib/index.js CHANGED
@@ -22,8 +22,11 @@
22
22
  * path that records without it.
23
23
  */
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.useLatestCaption = exports.useVoiceActivity = exports.VoiceReactive = exports.CrowdPlayVoiceView = exports.CrowdPlayVideoView = exports.CrowdPlayConsentScreen = void 0;
25
+ exports.useLatestCaption = exports.useVoiceActivity = exports.VoiceReactive = exports.CrowdPlayVoiceView = exports.CrowdPlayVideoView = exports.CrowdPlayConsentScreen = exports.CROWDPLAY_TERMS_URL = void 0;
26
26
  const react_native_1 = require("react-native");
27
+ /** The CrowdPlay Terms of Use and Privacy Notice every participant accepts,
28
+ * as a PDF. CrowdPlayConsentScreen links here; a custom consent UI must too. */
29
+ exports.CROWDPLAY_TERMS_URL = 'https://dashboard.crowdplay.ai/legal/terms.pdf';
27
30
  function native() {
28
31
  const module = react_native_1.NativeModules.CrowdPlayReactNative;
29
32
  if (!module) {
package/llms.txt CHANGED
@@ -57,7 +57,8 @@ its video calls invisibly; recording is infrastructure, not identity:
57
57
  in an app using this SDK. The engine owns the microphone and camera.
58
58
  3. NEVER skip or fake consent. CrowdPlay.join() THROWS without a ConsentGrant,
59
59
  and the user must actually SEE the consent wording first; use
60
- <CrowdPlayConsentScreen/>, or show CrowdPlay.consentText() verbatim in your own
60
+ <CrowdPlayConsentScreen/>, or show CrowdPlay.consentText() verbatim (plus a
61
+ link to CROWDPLAY_TERMS_URL, the full Terms of Use and Privacy Notice) in your own
61
62
  UI and construct { grantedAtMs: Date.now() } at the moment of
62
63
  agreement. Fabricating a grant creates false legal evidence.
63
64
  4. iOS only. Guard any non-iOS platform path; the module throws elsewhere
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "crowdplaysdk",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "CrowdPlay lossless conversation capture for React Native (iOS). Studio-grade per-participant recording during live video calls, delivered to CrowdPlay automatically.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -1,8 +1,9 @@
1
1
  /**
2
2
  * Drop-in consent screen. Shows CrowdPlay's locked consent wording (fetched from
3
- * the native SDK so it can never drift from what the manifest records), a
4
- * switch, and a continue button that only enables once the participant
5
- * agrees. Yields the ConsentGrant that join() requires.
3
+ * the native SDK so it can never drift from what the manifest records), a link
4
+ * to the full CrowdPlay Terms of Use and Privacy Notice, a switch, and a
5
+ * continue button that only enables once the participant agrees. Yields the
6
+ * ConsentGrant that join() requires.
6
7
  *
7
8
  * <CrowdPlayConsentScreen onConsent={(grant) => joinWith(grant)} />
8
9
  *
@@ -12,8 +13,8 @@
12
13
  */
13
14
 
14
15
  import React, { useEffect, useState } from 'react';
15
- import { ActivityIndicator, Pressable, StyleSheet, Switch, Text, View } from 'react-native';
16
- import CrowdPlay, { type ConsentGrant } from './index';
16
+ import { ActivityIndicator, Linking, Pressable, StyleSheet, Switch, Text, View } from 'react-native';
17
+ import CrowdPlay, { CROWDPLAY_TERMS_URL, type ConsentGrant } from './index';
17
18
 
18
19
  export interface CrowdPlayConsentScreenProps {
19
20
  onConsent: (grant: ConsentGrant) => void;
@@ -48,6 +49,9 @@ export function CrowdPlayConsentScreen({ onConsent, style }: CrowdPlayConsentScr
48
49
  ) : (
49
50
  <Text style={styles.body}>{text}</Text>
50
51
  )}
52
+ <Pressable accessibilityRole="link" onPress={() => void Linking.openURL(CROWDPLAY_TERMS_URL)}>
53
+ <Text style={styles.link}>Read the Terms of Use and Privacy Notice</Text>
54
+ </Pressable>
51
55
  <View style={styles.row}>
52
56
  <Switch
53
57
  value={agreed}
@@ -56,7 +60,7 @@ export function CrowdPlayConsentScreen({ onConsent, style }: CrowdPlayConsentScr
56
60
  setAgreedAtMs(value ? Date.now() : null);
57
61
  }}
58
62
  />
59
- <Text style={styles.agree}>I agree</Text>
63
+ <Text style={styles.agree}>I have read and agree to the CrowdPlay Terms of Use and Privacy Notice.</Text>
60
64
  </View>
61
65
  <Text style={styles.note}>
62
66
  Recording starts automatically when you join, and ends when you leave.
@@ -88,7 +92,8 @@ const styles = StyleSheet.create({
88
92
  title: { fontSize: 20, fontWeight: '700', color: '#111111' },
89
93
  body: { fontSize: 15, lineHeight: 21, color: '#222222' },
90
94
  row: { flexDirection: 'row', alignItems: 'center', gap: 10 },
91
- agree: { fontSize: 15, color: '#111111' },
95
+ agree: { flex: 1, fontSize: 15, color: '#111111' },
96
+ link: { fontSize: 15, color: '#1f6feb', textDecorationLine: 'underline' },
92
97
  note: { fontSize: 12, color: '#666666' },
93
98
  button: { backgroundColor: '#1f6feb', borderRadius: 8, paddingVertical: 12, alignItems: 'center' },
94
99
  buttonDisabled: { opacity: 0.4 },
package/src/index.ts CHANGED
@@ -68,6 +68,10 @@ export interface CrowdPlayConfig {
68
68
  callQuality?: CallQuality;
69
69
  }
70
70
 
71
+ /** The CrowdPlay Terms of Use and Privacy Notice every participant accepts,
72
+ * as a PDF. CrowdPlayConsentScreen links here; a custom consent UI must too. */
73
+ export const CROWDPLAY_TERMS_URL = 'https://dashboard.crowdplay.ai/legal/terms.pdf';
74
+
71
75
  /** Proof the participant agreed. Produce it with CrowdPlayConsentScreen, or,
72
76
  * if you render your own consent UI, call CrowdPlay.consentText() to show the
73
77
  * REQUIRED wording and construct the grant at the moment of agreement. */