16
16
17
17
* [ alias] ( analytics.client.md#alias )
18
18
* [ catch] ( analytics.client.md#catch )
19
- * [ configure] ( analytics.client.md#configure )
20
19
* [ disable] ( analytics.client.md#disable )
21
20
* [ enable] ( analytics.client.md#enable )
22
21
* [ flush] ( analytics.client.md#flush )
25
24
* [ middleware] ( analytics.client.md#middleware )
26
25
* [ reset] ( analytics.client.md#reset )
27
26
* [ screen] ( analytics.client.md#screen )
27
+ * [ setup] ( analytics.client.md#setup )
28
28
* [ track] ( analytics.client.md#track )
29
29
* [ useNativeConfiguration] ( analytics.client.md#usenativeconfiguration )
30
30
38
38
39
39
** ● ready** : * ` false ` * = false
40
40
41
- * Defined in analytics.ts:15 *
41
+ * Defined in [ analytics.ts:96 ] ( https://github.com/segmentio/analytics-react-native/blob/master/packages/core/src/analytics.ts#L96 ) *
42
42
43
43
Whether the client is ready to send events to Segment.
44
44
54
54
55
55
▸ ** alias** (newId: * ` string ` * ): ` Promise ` <` void ` >
56
56
57
- * Defined in analytics.ts:174 *
57
+ * Defined in [ analytics.ts:260 ] ( https://github.com/segmentio/analytics-react-native/blob/master/packages/core/src/analytics.ts#L260 ) *
58
58
59
59
Merge two user identities, effectively connecting two sets of user data as one. This may not be supported by all integrations.
60
60
75
75
76
76
▸ ** catch** (handler: * [ ErrorHandler] ( ) * ): ` this `
77
77
78
- * Defined in analytics.ts:28 *
78
+ * Defined in [ analytics.ts:109 ] ( https://github.com/segmentio/analytics-react-native/blob/master/packages/core/src/analytics.ts#L109 ) *
79
79
80
80
Catch React-Native bridge errors
81
81
@@ -89,39 +89,14 @@ These errors are emitted when calling the native counterpart.
89
89
90
90
** Returns:** ` this `
91
91
92
- ___
93
- <a id =" configure " ></a >
94
-
95
- ### configure
96
-
97
- ▸ ** configure** (): [ Configuration] ( ../interfaces/analytics.chainedconfiguration.configuration.md )
98
-
99
- * Defined in analytics.ts:102*
100
-
101
- Configure the Analytics module.
102
-
103
- This method returns a fluent-style API to configure the SDK :
104
-
105
- ``` js
106
- analytics
107
- .configure ()
108
- .using (Mixpanel, GoogleAnalytics)
109
- .trackAppLifecycle ()
110
- .ios ()
111
- .trackDeepLinks ()
112
- .setup (" YOUR_WRITE_KEY" )
113
- ```
114
-
115
- ** Returns:** [ Configuration] ( ../interfaces/analytics.chainedconfiguration.configuration.md )
116
-
117
92
___
118
93
<a id =" disable " ></a >
119
94
120
95
### disable
121
96
122
97
▸ ** disable** (): ` Promise ` <` void ` >
123
98
124
- * Defined in analytics.ts:213 *
99
+ * Defined in [ analytics.ts:299 ] ( https://github.com/segmentio/analytics-react-native/blob/master/packages/core/src/analytics.ts#L299 ) *
125
100
126
101
Completely disable the sending of any analytics data.
127
102
136
111
137
112
▸ ** enable** (): ` Promise ` <` void ` >
138
113
139
- * Defined in analytics.ts:203 *
114
+ * Defined in [ analytics.ts:289 ] ( https://github.com/segmentio/analytics-react-native/blob/master/packages/core/src/analytics.ts#L289 ) *
140
115
141
116
Enable the sending of analytics data. Enabled by default.
142
117
151
126
152
127
▸ ** flush** (): ` Promise ` <` void ` >
153
128
154
- * Defined in analytics.ts:194 *
129
+ * Defined in [ analytics.ts:280 ] ( https://github.com/segmentio/analytics-react-native/blob/master/packages/core/src/analytics.ts#L280 ) *
155
130
156
131
Trigger an upload of all queued events.
157
132
166
141
167
142
▸ ** group** (groupId: * ` string ` * , traits?: * ` JsonMap ` * ): ` Promise ` <` void ` >
168
143
169
- * Defined in analytics.ts:161 *
144
+ * Defined in [ analytics.ts:247 ] ( https://github.com/segmentio/analytics-react-native/blob/master/packages/core/src/analytics.ts#L247 ) *
170
145
171
146
Associate a user with a group, organization, company, project, or w/e _ you_ call them.
172
147
188
163
189
164
▸ ** identify** (user: * ` string ` * , traits?: * ` JsonMap ` * ): ` Promise ` <` void ` >
190
165
191
- * Defined in analytics.ts:149 *
166
+ * Defined in [ analytics.ts:235 ] ( https://github.com/segmentio/analytics-react-native/blob/master/packages/core/src/analytics.ts#L235 ) *
192
167
193
168
Associate a user with their unique ID and record traits about them.
194
169
210
185
211
186
▸ ** middleware** (middleware: * [ Middleware] ( ) * ): ` this `
212
187
213
- * Defined in analytics.ts:66 *
188
+ * Defined in [ analytics.ts:147 ] ( https://github.com/segmentio/analytics-react-native/blob/master/packages/core/src/analytics.ts#L147 ) *
214
189
215
190
Append a new middleware to the middleware chain.
216
191
248
223
249
224
▸ ** reset** (): ` Promise ` <` void ` >
250
225
251
- * Defined in analytics.ts:184 *
226
+ * Defined in [ analytics.ts:270 ] ( https://github.com/segmentio/analytics-react-native/blob/master/packages/core/src/analytics.ts#L270 ) *
252
227
253
228
Reset any user state that is cached on the device.
254
229
263
238
264
239
▸ ** screen** (name: * ` string ` * , properties?: * ` JsonMap ` * ): ` Promise ` <` void ` >
265
240
266
- * Defined in analytics.ts:135 *
241
+ * Defined in [ analytics.ts:221 ] ( https://github.com/segmentio/analytics-react-native/blob/master/packages/core/src/analytics.ts#L221 ) *
267
242
268
243
Record the screens or views your users see.
269
244
@@ -278,14 +253,44 @@ When a user views a screen in your app, you'll want to record that here. For som
278
253
279
254
** Returns:** ` Promise ` <` void ` >
280
255
256
+ ___
257
+ <a id =" setup " ></a >
258
+
259
+ ### setup
260
+
261
+ ▸ ** setup** (writeKey: * ` string ` * , configuration?: * [ Configuration] ( ../interfaces/analytics.configuration.md ) * ): ` Promise ` <` void ` >
262
+
263
+ * Defined in [ analytics.ts:186] ( https://github.com/segmentio/analytics-react-native/blob/master/packages/core/src/analytics.ts#L186 ) *
264
+
265
+ Setup the Analytics module. All calls made before are queued and executed if the configuration was successful.
266
+
267
+ ``` js
268
+ await analytics .setup (' YOUR_WRITE_KEY' , {
269
+ using: [Mixpanel, GoogleAnalytics],
270
+ trackAppLifecycleEvents: true ,
271
+ ios: {
272
+ trackDeepLinks: true
273
+ }
274
+ })
275
+ ```
276
+
277
+ ** Parameters:**
278
+
279
+ | Param | Type | Default value | Description |
280
+ | ------ | ------ | ------ | ------ |
281
+ | writeKey | ` string ` | - | Your Segment.io write key |
282
+ | ` Default value ` configuration | [ Configuration] ( ../interfaces/analytics.configuration.md ) | {} | An optional [ Configuration] ( ../interfaces/analytics.configuration.md ) object. |
283
+
284
+ ** Returns:** ` Promise ` <` void ` >
285
+
281
286
___
282
287
<a id =" track " ></a >
283
288
284
289
### track
285
290
286
291
▸ ** track** (event: * ` string ` * , properties?: * ` JsonMap ` * ): ` Promise ` <` void ` >
287
292
288
- * Defined in analytics.ts:117 *
293
+ * Defined in [ analytics.ts:203 ] ( https://github.com/segmentio/analytics-react-native/blob/master/packages/core/src/analytics.ts#L203 ) *
289
294
290
295
Record the actions your users perform.
291
296
307
312
308
313
▸ ** useNativeConfiguration** (): ` this `
309
314
310
- * Defined in analytics.ts:78 *
315
+ * Defined in [ analytics.ts:159 ] ( https://github.com/segmentio/analytics-react-native/blob/master/packages/core/src/analytics.ts#L159 ) *
311
316
312
317
Use the native configuration.
313
318
0 commit comments