crowdplaysdk 0.5.0 → 0.5.2

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 Policy, 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 Policy, 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);
@@ -72,18 +70,17 @@ function CrowdPlayConsentScreen({ onConsent, style }) {
72
70
  };
73
71
  }, []);
74
72
  return (<react_native_1.View style={[styles.container, style]}>
75
- <react_native_1.Text style={styles.title}>Recording consent</react_native_1.Text>
76
- {text === null ? (<react_native_1.ActivityIndicator />) : (<react_native_1.Text style={styles.body}>{text}</react_native_1.Text>)}
73
+ <react_native_1.Text style={styles.title}>Before you join</react_native_1.Text>
74
+ <react_native_1.Pressable accessibilityRole="link" onPress={() => void react_native_1.Linking.openURL(index_1.CROWDPLAY_TERMS_URL)}>
75
+ <react_native_1.Text style={styles.link}>Read the Terms of Use and Privacy Policy</react_native_1.Text>
76
+ </react_native_1.Pressable>
77
77
  <react_native_1.View style={styles.row}>
78
78
  <react_native_1.Switch value={agreed} onValueChange={(value) => {
79
79
  setAgreed(value);
80
80
  setAgreedAtMs(value ? Date.now() : null);
81
81
  }}/>
82
- <react_native_1.Text style={styles.agree}>I agree</react_native_1.Text>
82
+ {text === null ? <react_native_1.ActivityIndicator /> : <react_native_1.Text style={styles.agree}>{text}</react_native_1.Text>}
83
83
  </react_native_1.View>
84
- <react_native_1.Text style={styles.note}>
85
- Recording starts automatically when you join, and ends when you leave.
86
- </react_native_1.Text>
87
84
  <react_native_1.Pressable accessibilityRole="button" disabled={!agreed || agreedAtMs === null} onPress={() => {
88
85
  if (agreedAtMs !== null)
89
86
  onConsent({ grantedAtMs: agreedAtMs });
@@ -105,7 +102,8 @@ const styles = react_native_1.StyleSheet.create({
105
102
  title: { fontSize: 20, fontWeight: '700', color: '#111111' },
106
103
  body: { fontSize: 15, lineHeight: 21, color: '#222222' },
107
104
  row: { flexDirection: 'row', alignItems: 'center', gap: 10 },
108
- agree: { fontSize: 15, color: '#111111' },
105
+ agree: { flex: 1, fontSize: 15, color: '#111111' },
106
+ link: { fontSize: 15, color: '#1f6feb', textDecorationLine: 'underline' },
109
107
  note: { fontSize: 12, color: '#666666' },
110
108
  button: { backgroundColor: '#1f6feb', borderRadius: 8, paddingVertical: 12, alignItems: 'center' },
111
109
  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.2",
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 Policy, 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;
@@ -42,12 +43,10 @@ export function CrowdPlayConsentScreen({ onConsent, style }: CrowdPlayConsentScr
42
43
 
43
44
  return (
44
45
  <View style={[styles.container, style]}>
45
- <Text style={styles.title}>Recording consent</Text>
46
- {text === null ? (
47
- <ActivityIndicator />
48
- ) : (
49
- <Text style={styles.body}>{text}</Text>
50
- )}
46
+ <Text style={styles.title}>Before you join</Text>
47
+ <Pressable accessibilityRole="link" onPress={() => void Linking.openURL(CROWDPLAY_TERMS_URL)}>
48
+ <Text style={styles.link}>Read the Terms of Use and Privacy Policy</Text>
49
+ </Pressable>
51
50
  <View style={styles.row}>
52
51
  <Switch
53
52
  value={agreed}
@@ -56,11 +55,8 @@ export function CrowdPlayConsentScreen({ onConsent, style }: CrowdPlayConsentScr
56
55
  setAgreedAtMs(value ? Date.now() : null);
57
56
  }}
58
57
  />
59
- <Text style={styles.agree}>I agree</Text>
58
+ {text === null ? <ActivityIndicator /> : <Text style={styles.agree}>{text}</Text>}
60
59
  </View>
61
- <Text style={styles.note}>
62
- Recording starts automatically when you join, and ends when you leave.
63
- </Text>
64
60
  <Pressable
65
61
  accessibilityRole="button"
66
62
  disabled={!agreed || agreedAtMs === null}
@@ -88,7 +84,8 @@ const styles = StyleSheet.create({
88
84
  title: { fontSize: 20, fontWeight: '700', color: '#111111' },
89
85
  body: { fontSize: 15, lineHeight: 21, color: '#222222' },
90
86
  row: { flexDirection: 'row', alignItems: 'center', gap: 10 },
91
- agree: { fontSize: 15, color: '#111111' },
87
+ agree: { flex: 1, fontSize: 15, color: '#111111' },
88
+ link: { fontSize: 15, color: '#1f6feb', textDecorationLine: 'underline' },
92
89
  note: { fontSize: 12, color: '#666666' },
93
90
  button: { backgroundColor: '#1f6feb', borderRadius: 8, paddingVertical: 12, alignItems: 'center' },
94
91
  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. */