Skip to content

Commit

Permalink
📝 Add docstrings to feat.move-error-reporting-to-core-sdk-2826
Browse files Browse the repository at this point in the history
Docstrings generation was requested by @saikumarrs.

* #1984 (comment)

The following files were modified:

* `packages/analytics-js/__tests__/nativeSdkLoader.js`
  • Loading branch information
coderabbitai[bot] authored Jan 10, 2025
1 parent 7a74983 commit 25330a4
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions packages/analytics-js/__tests__/nativeSdkLoader.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
/**
* Initializes the RudderStack JavaScript SDK with the provided configuration.
*
* @param {string} writeKey - The write key for the RudderStack project.
* @param {string} dpUrl - The data plane URL for sending analytics data.
* @param {Object} [loadOptions={}] - Optional configuration options for loading the SDK.
*
* @description
* This function sets up the RudderStack analytics library by:
* - Ensuring the SDK is only initialized once
* - Defining global analytics methods for tracking events
* - Setting up a global context for the SDK
* - Loading the SDK with the provided configuration
*
* @throws {Error} Logs an error if the SDK snippet is included multiple times.
*
* @example
* loadingSnippet('your_write_key', 'https://your-dataplane-url.com', {
* integrations: { All: true }
* });
*/
function loadingSnippet(writeKey, dpUrl, loadOptions) {
(function () {
'use strict';
Expand Down

0 comments on commit 25330a4

Please sign in to comment.