import {Fragment} from 'react'; import ExternalLink from 'sentry/components/links/externalLink'; import {Layout, LayoutProps} from 'sentry/components/onboarding/gettingStartedDoc/layout'; import {ModuleProps} from 'sentry/components/onboarding/gettingStartedDoc/sdkDocumentation'; import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/step'; import {t, tct} from 'sentry/locale'; // Configuration Start export const steps = ({ dsn, }: { dsn?: string; } = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: t('Install our SDK using the cordova command:'), configurations: [ { language: 'bash', code: 'cordova plugin add sentry-cordova', }, ], }, { type: StepType.CONFIGURE, description: (

{tct( 'You should [initCode:init] the SDK in the [deviceReadyCode:deviceReady] function, to make sure the native integrations runs. For more details about Cordova [link:click here]', { initCode: , deviceReadyCode: , link: ( ), } )}

), configurations: [ { language: 'javascript', code: ` onDeviceReady: function() { var Sentry = cordova.require('sentry-cordova.Sentry'); Sentry.init({ dsn: '${dsn}' }); } `, }, ], }, { type: StepType.VERIFY, description: ( {t( 'One way to verify your setup is by intentionally causing an error that breaks your application.' )}

{t('Calling an undefined function will throw an exception:')}

), configurations: [ { language: 'javascript', code: 'myUndefinedFunction();', }, ], }, ]; // Configuration End export function GettingStartedWithCordova({dsn, ...props}: ModuleProps) { return ; } export default GettingStartedWithCordova;