Sentry

Getting Started

Setting up Sentry in your SwiftStruct project.


Create a Sentry account and project

  1. Go to the Sentry website
  2. Create an account or sign in to your existing account
  3. Create a new organization (if you don't have one)
  4. Create a new project in your organization
  5. Select iOS as the platform when prompted

Get your DSN

  1. After creating your project, navigate to SettingsProjectsYour Project
  2. Go to Client Keys (DSN)
  3. Copy the DSN value

Get your Auth Token

  1. Go to Sentry API
  2. Sign in to your Sentry account
  3. Click "Create New Token" or navigate to SettingsAuth Tokens
  4. Give your token a name (e.g., "SwiftStruct Project")
  5. Select the scopes you need (typically project:read, project:write, org:read)
  6. Click "Create Token"
  7. 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/ or acme.sentry.io/, then acme is 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

  1. Add the following environment variables to your .env file:

    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
  2. 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.

Previous
Storage