You can use the leaveBreadcrumb method to log potentially useful events in your own applications: Bugsnag. Power state changes, like switching to battery powerįor more information or to disable particular classes of automatic breadcrumb generation see configuration options.Display added, removed, and resized events.Automatically captured breadcrumbsīy default, Bugsnag captures the following events as breadcrumbs: A configurable number of breadcrumbs are attached to each error report to help diagnose what events led to the error. In order to understand what happened in your application before each crash, it can be helpful to leave short log statements that we call breadcrumbs. setUser ( '3', , 'Erina' )įor information on doing so, see Adding user data. You can set the user information of an error report using the user configuration property when Bugsnag starts or using tUser(): Bugsnag. In order to correlate errors with customer reports, or to see a list of users who experienced each error, it is helpful to capture and display user information on your Bugsnag dashboard. start ()įor more information, see Customizing error reports. Start Bugsnag along with any renderer-specific configuration as needed: Bugsnag. When it is true, require() works as it does in Node.js. Your client-side ID is available in the Environments tab of your project under Account settings page.When webPreferences.nodeIntegration is false, a bundler (such as Webpack) is necessary to resolve dependencies in renderer code. The client-side ID authorizes your application to connect to a particular environment within LaunchDarkly. To set up the main process client, you need the client-side ID for your LaunchDarkly environment, an object containing user properties, and optional configuration properties. In the normal use case, there is an SDK client running in the main process and the renderer processes can then create client instances that are in effect mirrors of the main one. We designed the LaunchDarkly Electron SDK to use LaunchDarkly feature flags from within any of these processes. These processes have their own independent JavaScript engines and data spaces, although there are ways to communicate between them. # In earlier versions, the package name was ldclient-electron COPY Initializing the clientĮvery Electron application consists of a main process, which is similar to a Node.js application, and some number of renderer processes, each of which is a Chromium web browser with its own window. The resulting object uses the Node-style API. When you create the main-process client, after you call initializeInMain, pass the client object to createNodeSdkAdapter. To make this transition easier, the LaunchDarkly Electron SDK provides an optional wrapper that emulates the Node.js SDK. For instance, in the server-side Node SDK, variation() is an asynchronous call that takes a callback, whereas in the client-side SDKs it is synchronous. The Electron SDK also includes features that are specific to Electron, such as the ability to access main-process flags from the front end as described below.įor developers who were using the server-side Node.js in Electron before the Electron SDK was available, there are differences between the APIs that can be inconvenient.The client-side and mobile SDKs, which normally evaluate flags for just one user at a time, use a much more efficient protocol where they request only the active variation for each flag for that specific user. The server-side SDKs download your entire flag data using this key, because they have to be able to evaluate flags quickly for any user.The client-side and mobile SDKs use different credentials that do not allow this. If you embed this SDK key in an application, any user who looks inside the application can then access all of your feature flag definitions, which may include sensitive data such as other users' email addresses. The server-side SDKs include an SDK key that can download the entire definition, including rollout rules and individual user targets, of all of your feature flags.There are several reasons why this distinction matters: However, we strongly discourage this because the server-side Node.js SDK is not meant for applications that are distributed to users. Why use this instead of the Node.js SDK?īecause Electron is based on Node.js, it is possible to run the LaunchDarkly server-side Node.js SDK in it. To learn more, read Using LaunchDarkly with TypeScript. The sample code snippets for this SDK are available in both JavaScript and TypeScript, where the sample code differs.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |