Skip to content

Conversation

MMiller-Hairston
Copy link

@MMiller-Hairston MMiller-Hairston commented Aug 24, 2025

Updating the domains option to match documentation and implementation in other libraries

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Summary

This pull request updates the WorkOS Elixir SDK to align with changes in the WorkOS API for organization management. The main change involves replacing the :domains parameter with :domain_data in the create_organization and update_organization functions within lib/workos/organizations.ex.

The key difference is structural: where :domains previously accepted simple domain strings, :domain_data now expects an array of maps containing both domain and state fields (e.g., [%{domain: "example.com", state: "pending"}]). This change enables the API to track domain verification states, which is crucial for enterprise SSO scenarios where organizations need to verify domain ownership.

The corresponding test file test/workos/organizations_test.exs has been updated to reflect this new data structure, with all test cases now using the domain_data format. The tests maintain the same coverage while properly mocking the expected structured data.

This change integrates with the broader WorkOS platform's domain verification workflow, allowing organizations to manage domains through different verification states rather than treating them as simple strings. The SDK now supports the enhanced domain management capabilities that the WorkOS API provides.

Confidence score: 3/5

  • This PR introduces a breaking change that will require users to update their code when creating or updating organizations
  • Score reflects the breaking nature of the change and potential for runtime errors if users don't update their implementation
  • Pay close attention to the parameter structure changes in lib/workos/organizations.ex and ensure proper migration documentation is provided

2 files reviewed, 1 comment

Edit Code Review Bot Settings | Greptile

@MMiller-Hairston
Copy link
Author

@hexedpackets Any chance I could get you or someone to look at this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant