Skip to content

Conversation

@tomas-martins-crossmint
Copy link
Contributor

This pull request implements a new setting to our SDK, which allows users to explicitly set if they want to allow our SDK to send diagnostics logs to DataDog. This has been implemented to comply with GDPR regulations, ensuring that we only send information to DataDog when the user has consented

Breaking Change

A new required trackingConsent parameter has been added to SDK initialization. All existing integrations must be updated to pass a consent status when initializing the SDK instance:

let sdk = CrossmintSDK.shared(
    apiKey: apiKey,
    trackingConsent: .granted
)

Consent Levels

There are three levels of consent that users can set:

  • .pending - SDK collects and batches data but doesn't send it to remote endpoints
  • .granted - SDK collects and sends data to remote logging endpoints
  • .notGranted - SDK doesn't collect any data for remote logging

Note: This only affects remote DataDog logging. Local logs sent through Swift's os.log continue to work regardless of the tracking consent setting, so messages are still displayed on Xcode's console

Updating Consent

It's also possible to update the consent status after initializing the SDK:

sdk.setTrackingConsent(.granted)

When updating consent:

  • .pending.granted sends all batched data to DataDog
  • .pending.notGranted wipes all batched data

CrossmintSDK.shared(
apiKey: crossmintApiKey,
authManager: crossmintAuthManager,
trackingConsent: .granted
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have two nits here:

  • If we change who we use for logging, or move away from datadog, we'll be forced to make a breaking change here
  • The user if they step into the code will see datadog documentation on granted vs notGranted vs pending -- we may have expanded use for this consent in the future, and we may want finer grained control over the documentation

@tomas-martins-crossmint tomas-martins-crossmint marked this pull request as draft December 12, 2025 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants