Skip to content

feat: Remove org-id annotation requirement#22

Merged
talissoncosta merged 1 commit intomainfrom
feat/remove-org-id-annotation-clean
Feb 24, 2026
Merged

feat: Remove org-id annotation requirement#22
talissoncosta merged 1 commit intomainfrom
feat/remove-org-id-annotation-clean

Conversation

@talissoncosta
Copy link
Contributor

@talissoncosta talissoncosta commented Feb 24, 2026

Summary

This PR simplifies the plugin configuration by removing the flagsmith.com/org-id annotation requirement. The organization ID is now automatically derived from the project data, reducing the configuration burden on users.

Changes

Core Changes

  • Removed org-id annotation requirement: The useFlagsmithUsage hook now only requires project-id
  • Automatic org-id derivation: Organization ID is extracted from projectData.organisation
  • Simplified API: Removed orgId parameter from useFlagsmithUsage hook

Component Updates

  • Updated FlagsmithUsageCard to derive org-id from project data
  • Dashboard link construction now uses derived org-id

Developer Experience

  • Added /flagsmith-complete demo page: Shows all three components (FlagsTab, Overview Card, Usage Card) on one screen
  • Perfect for testing, screenshots, and documentation
  • Demonstrates the simplified annotation requirement

Documentation

  • Updated README to remove org-id annotation from examples
  • Added documentation prompt for contributing Backstage docs to main Flagsmith repo
  • Added note explaining automatic org-id derivation

Tests

  • Updated useFlagsmithUsage.test.tsx to reflect simplified API
  • Removed all org-id parameters from test cases

Before vs After

Before:

annotations:
  flagsmith.com/project-id: '12345'
  flagsmith.com/org-id: '67890'  # Required

After:

annotations:
  flagsmith.com/project-id: '12345'
  # Organization ID automatically derived! ✨

Benefits

  1. Simpler configuration: Users only need to provide one annotation instead of two
  2. DRY principle: We don't ask users for data we can fetch ourselves
  3. Better UX: Less chance of configuration errors
  4. Consistent with FlagsTab: Already uses this pattern successfully

Testing

All three components work with only project-id annotation:

  • ✅ Feature Flags Tab
  • ✅ Overview Card
  • ✅ Usage Card

Try it out: yarn start and visit /flagsmith-complete

Breaking Changes

⚠️ This is technically a breaking change to the API signature of useFlagsmithUsage, but:

  • The org-id annotation was already documented as "optional"
  • Existing users with org-id annotation will continue to work (it's just ignored)
  • This simplifies the API and improves the user experience

- Remove org-id annotation requirement - automatically derive from project data
- Simplify useFlagsmithUsage hook to only require project-id
- Update FlagsmithUsageCard to derive org-id from project
- Add /flagsmith-complete demo page showing all three components
- Update tests to reflect simplified API
- Update documentation to remove org-id references

This improves developer experience by reducing required configuration.
The organization ID is always available in the project response, so
requiring users to manually provide it was unnecessary.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@talissoncosta talissoncosta marked this pull request as ready for review February 24, 2026 12:49
@talissoncosta talissoncosta changed the title feat: remove org-id annotation requirement feat: Remove org-id annotation requirement Feb 24, 2026
talissoncosta added a commit to Flagsmith/flagsmith that referenced this pull request Feb 24, 2026
The org-id annotation is no longer required as it's automatically derived
from the project data by the plugin (see Flagsmith/flagsmith-backstage-plugin#22).

Changes:
- Removed org-id from Prerequisites
- Removed org-id from Entity Annotations example and table
- Added tip explaining automatic org-id derivation
- Removed Organisation ID section from Getting Your Credentials

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
talissoncosta added a commit to Flagsmith/flagsmith that referenced this pull request Feb 24, 2026
The org-id annotation is no longer required as it's automatically derived
from the project data by the plugin (see Flagsmith/flagsmith-backstage-plugin#22).

Changes:
- Removed org-id from Prerequisites
- Removed org-id from Entity Annotations example and table
- Added tip explaining automatic org-id derivation
- Removed Organisation ID section from Getting Your Credentials

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
talissoncosta

This comment was marked as outdated.

@talissoncosta talissoncosta merged commit e15085f into main Feb 24, 2026
5 checks passed
talissoncosta added a commit to Flagsmith/flagsmith that referenced this pull request Feb 24, 2026
The org-id annotation is no longer required as it's automatically derived
from the project data by the plugin (see Flagsmith/flagsmith-backstage-plugin#22).

Changes:
- Removed org-id from Prerequisites
- Removed org-id from Entity Annotations example and table
- Added tip explaining automatic org-id derivation
- Removed Organisation ID section from Getting Your Credentials

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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.

2 participants