Sentry
Getting Started
Setting up Sentry in your SwiftStruct project.
Create a Sentry account and project
- Go to the Sentry website
- Create an account or sign in to your existing account
- Create a new organization (if you don't have one)
- Create a new project in your organization
- Select iOS as the platform when prompted
Get your DSN
- After creating your project, navigate to Settings → Projects → Your Project
- Go to Client Keys (DSN)
- Copy the DSN value
Get your Auth Token
- Go to Sentry API
- Sign in to your Sentry account
- Click "Create New Token" or navigate to Settings → Auth Tokens
- Give your token a name (e.g., "SwiftStruct Project")
- Select the scopes you need (typically
project:read,project:write,org:read) - Click "Create Token"
- Copy the token immediately (you won't be able to see it again)
Get your Organization and Project slugs
- Organization slug: This is the slug in your Sentry URL. For example, if your URL is
sentry.io/acme/oracme.sentry.io/, thenacmeis your organization slug. - Project slug: This is the name/slug of your project. You can find it in your project settings or in the URL when viewing your project.
Configure your project
Add the following environment variables to your
.envfile:IOS_SENTRY_DSN=your-dsn-here SENTRY_AUTH_TOKEN=your-auth-token-here SENTRY_ORG_SLUG=your-organization-slug SENTRY_PROJECT_SLUG=your-project-slug- IOS_SENTRY_DSN: The Data Source Name that identifies your Sentry project and allows the SDK to send events to Sentry
- SENTRY_AUTH_TOKEN: An authentication token used for API access to upload source maps, create releases, and perform other automated tasks
- SENTRY_ORG_SLUG: Your organization identifier in Sentry
- SENTRY_PROJECT_SLUG: Your project identifier in Sentry
Run the environment sync command to apply the changes:
npm run ios:env:sync
Your Sentry integration is now configured and ready to capture errors and performance data.