Skip to content

Commit c40fccd

Browse files
priscilawebdevandrewshie-sentry
authored andcommitted
feat: Add Nintendo Switch getting started doc (#96415)
1 parent 33d196b commit c40fccd

File tree

1 file changed

+161
-0
lines changed

1 file changed

+161
-0
lines changed
Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
import {Button} from 'sentry/components/core/button';
2+
import {ExternalLink} from 'sentry/components/core/link';
3+
import List from 'sentry/components/list';
4+
import ListItem from 'sentry/components/list/listItem';
5+
import {
6+
type Docs,
7+
type OnboardingConfig,
8+
StepType,
9+
} from 'sentry/components/onboarding/gettingStartedDoc/types';
10+
import {IconLock} from 'sentry/icons/iconLock';
11+
import {t, tct} from 'sentry/locale';
12+
13+
const onboarding: OnboardingConfig = {
14+
install: () => [
15+
{
16+
type: StepType.INSTALL,
17+
content: [
18+
{
19+
type: 'text',
20+
text: tct(
21+
'Our [sentrySwitchLink:Sentry Switch SDK] extends the core [sentryNativeLink:sentry-native] library with Nintendo Switch-specific implementations and is designed to work across standalone engines and proprietary game engines.',
22+
{
23+
sentrySwitchLink: (
24+
<ExternalLink href="https://github.com/getsentry/sentry-switch" />
25+
),
26+
sentryNativeLink: (
27+
<ExternalLink href="https://github.com/getsentry/sentry-native" />
28+
),
29+
}
30+
),
31+
},
32+
{
33+
type: 'alert',
34+
alertType: 'warning',
35+
icon: <IconLock size="sm" locked />,
36+
text: tct(
37+
'[strong:Access Restricted]. The Switch SDK is distributed through a private repository under NDA.',
38+
{
39+
strong: <strong />,
40+
}
41+
),
42+
showIcon: true,
43+
trailingItems: (
44+
<Button size="sm" priority="primary">
45+
{t('Request Access')}
46+
</Button>
47+
),
48+
},
49+
{
50+
type: 'text',
51+
text: t(
52+
'Once the access is granted, you can proceed with the SDK integration.'
53+
),
54+
},
55+
],
56+
},
57+
],
58+
configure: params => [
59+
{
60+
type: StepType.CONFIGURE,
61+
content: [
62+
{
63+
type: 'text',
64+
text: tct(
65+
'After building the SDK, you can integrate it as a static library into your game. The SDK handles crash reporting automatically, with crash context forwarded to Sentry via CRPortal.',
66+
{
67+
code: <code />,
68+
}
69+
),
70+
},
71+
{
72+
type: 'text',
73+
text: t(
74+
'The SDK also supports sending additional runtime events, which requires:'
75+
),
76+
},
77+
{
78+
type: 'custom',
79+
content: (
80+
<List symbol="bullet">
81+
<ListItem>
82+
{tct(
83+
'Providing a valid [strong:database path] via [code:sentry_options_set_database_path()]',
84+
{code: <code />, strong: <strong />}
85+
)}
86+
</ListItem>
87+
<ListItem>
88+
{tct(
89+
'Ensuring [strong:network access] is properly initialized and providing a thread-safe network request callback',
90+
{code: <code />, strong: <strong />}
91+
)}
92+
</ListItem>
93+
</List>
94+
),
95+
},
96+
{
97+
type: 'text',
98+
text: tct(
99+
'The [privateRepositoryLink:private repository] contains complete setup instructions and configuration examples in the sample folder. Here is a basic example of how to initialize the SDK:',
100+
{
101+
privateRepositoryLink: (
102+
<ExternalLink href="https://github.com/getsentry/sentry-switch" />
103+
),
104+
}
105+
),
106+
},
107+
{
108+
type: 'code',
109+
language: 'c',
110+
code: `
111+
#include <sentry.h>
112+
113+
int main(void) {
114+
sentry_options_t *options = sentry_options_new();
115+
sentry_options_set_dsn(options, "${params.dsn.public}");
116+
// Example of Nintendo Switch-specific configuration options
117+
// (including database path) are available in
118+
// the sample folder of the private repository
119+
sentry_init(options);
120+
}
121+
`,
122+
},
123+
],
124+
},
125+
],
126+
verify: () => [
127+
{
128+
type: StepType.VERIFY,
129+
content: [
130+
{
131+
type: 'text',
132+
text: t(
133+
'Once integrated, verify that your Sentry integration is working correctly by sending a test event:'
134+
),
135+
},
136+
{
137+
type: 'code',
138+
language: 'c',
139+
code: `
140+
sentry_capture_event(sentry_value_new_message_event(
141+
/* level */ SENTRY_LEVEL_INFO,
142+
/* logger */ "custom",
143+
/* message */ "It works!"
144+
));`,
145+
},
146+
{
147+
type: 'text',
148+
text: t(
149+
'After sending this test event, you should see it appear in your Sentry dashboard, confirming that the Nintendo Switch integration is working correctly.'
150+
),
151+
},
152+
],
153+
},
154+
],
155+
};
156+
157+
const docs: Docs = {
158+
onboarding,
159+
};
160+
161+
export default docs;

0 commit comments

Comments
 (0)