Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
zihejia committed May 10, 2024
1 parent e48ec09 commit bcb762d
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/Mixpanel.html
Original file line number Diff line number Diff line change
Expand Up @@ -4516,7 +4516,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Mixpanel.
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Mon Apr 15 2024 22:35:54 GMT-0700 (Pacific Daylight Time)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Fri May 10 2024 11:47:39 GMT-0700 (Pacific Daylight Time)
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/MixpanelGroup.html
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Mixpanel.
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Mon Apr 15 2024 22:35:54 GMT-0700 (Pacific Daylight Time)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Fri May 10 2024 11:47:39 GMT-0700 (Pacific Daylight Time)
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/People.html
Original file line number Diff line number Diff line change
Expand Up @@ -1625,7 +1625,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Mixpanel.
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Mon Apr 15 2024 22:35:54 GMT-0700 (Pacific Daylight Time)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Fri May 10 2024 11:47:39 GMT-0700 (Pacific Daylight Time)
</footer>

<script> prettyPrint(); </script>
Expand Down
29 changes: 26 additions & 3 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,31 @@ <h3>Complete Code Example</h3>
export default SampleApp;

</code></pre>
<h3>Expo and React Native for Web support</h3>
<p>Starting from version 3.0.0, we have introduced support for Expo, React Native for Web, and other platforms utilizing React Native that do not support iOS and Android directly. To enable this feature, initialize Mixpanel with an additional parameter, <code>useNative</code>, set to false(<code>const mixpanel = new Mixpanel( &quot;YOUR_MIXPANEL_TOKEN&quot;, trackAutomaticEvents, useNative );</code>). This will activate JavaScript mode. Please note that this functionality is currently in beta testing. For further details and installation guidelines, refer to the release notes available at Mixpanel React Native <a href="https://github.com/mixpanel/mixpanel-react-native/releases/tag/v3.0.0-beta.1">v3.0.0-beta.1</a>.</p>
<h3>Expo and React Native for Web support (3.0.2 and above)</h3>
<p>Starting from version 3.0.2, we have introduced support for Expo, React Native for Web, and other platforms utilizing React Native that do not support iOS and Android directly.
To enable this feature,
<br>Step 1:</p>
<pre class="prettyprint source"><code>npm install @react-native-async-storage/async-storage
</code></pre>
<p>When JavaScript mode is enabled, Mixpanel utilizes <a href="https://react-native-async-storage.github.io/async-storage/">AsyncStorage</a> to persist data. If you prefer not to use it, or if AsyncStorage is unavailable in your target environment, you can import or define a different storage class. However, it must follow a subset (see: <a href="index.d.ts"><code>MixpanelAsyncStorage</code></a>) of the same interface as <a href="https://react-native-async-storage.github.io/async-storage/">AsyncStorage</a> The following example demonstrates how to use a custom storage solution:</p>
<pre class="prettyprint source"><code>// Optional: if you do not want to use the default AsyncStorage
const MyAsyncStorage = require(&quot;@my-org/&lt;library-path>/AsyncStorage&quot;);
const trackAutomaticEvents = false;
const useNative = false;
const mixpanel = new Mixpanel('YOUR_TOKEN', trackAutomaticEvents, useNative, MyAsyncStorage);
mixpanel.init();
</code></pre>
<p><br>Step 2:
Initialize Mixpanel with an additional parameter, <code>useNative</code>, set to false.</p>
<pre class="prettyprint source"><code>const trackAutomaticEvents = false;
const useNative = false;
const mixpanel = new Mixpanel(
&quot;YOUR_MIXPANEL_TOKEN&quot;,
trackAutomaticEvents,
useNative
);
</code></pre>
<p>This will activate JavaScript mode.</p>
<p>👋 👋 Tell us about the Mixpanel developer experience! <a href="https://www.mixpanel.com/devnps">https://www.mixpanel.com/devnps</a> 👍 👎</p>
<h2>FAQ</h2>
<p><strong>I want to stop tracking an event/event property in Mixpanel. Is that possible?</strong><br>
Expand Down Expand Up @@ -180,7 +203,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Mixpanel.
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Mon Apr 15 2024 22:35:54 GMT-0700 (Pacific Daylight Time)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Fri May 10 2024 11:47:39 GMT-0700 (Pacific Daylight Time)
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/index.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -1048,7 +1048,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Mixpanel.
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Mon Apr 15 2024 22:35:54 GMT-0700 (Pacific Daylight Time)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Fri May 10 2024 11:47:39 GMT-0700 (Pacific Daylight Time)
</footer>

<script> prettyPrint(); </script>
Expand Down

0 comments on commit bcb762d

Please sign in to comment.