General Migration Strategy
For all SDKs, follow this general approach when migrating:- Update imports and package references
- Convert fact representations to new format
- Replace bulk operations with batch API
- Migrate query calls to QueryBuilder API
- Update wildcard usage to explicit patterns
- Test thoroughly with new API patterns
Node.js Migration (v1 → v2)
The v2 release represents a significant rethinking of the developer experience. The biggest new feature is generating TypeScript types from your Polar policy. Key Changes:- Minimum Node.js version: 14 → 16
- Centralized authorization data API: 6 methods → 4 methods
- New QueryBuilder API replaces Query API
- TypeScript type generation from policies
Breaking Changes
- Facts API
- Batch Operations
- Query API
- TypeScript Types
New Features
Python Migration (v1 → v2)
The v2 release represents a significant rethinking of the developer experience with changes to fact representation and input types. Key Changes:- Facts now represented as tuples instead of dicts
- Arguments as Value objects instead of dicts
- Input types changed from Value/Fact to IntoValue/IntoFact
- Management API condensed from 6 methods to 4
Breaking Changes
- Fact Representation
- Input Types
- Management API
- Batch Operations
- Query API
New Features
- QueryBuilder Methods
- Value Types
Go Migration (v1 → v2)
The v2 release represents a significant rethinking of the developer experience with structural changes and new APIs. Key Changes:- Import path changed to include /v2
- Instance struct replaced with Value struct
- Separate FactPattern type for patterns
- Helper functions for ergonomic construction
- API condensed from 6 methods to 4
Breaking Changes
- Imports & Structs
- Batch Operations
- Query API
New Features
- Helper Functions
- QueryBuilder Methods
Java Migration (v0 → v1)
The v1 release represents a significant rethinking of the developer experience with the new Query Builder API and consolidated packages. Key Changes:- Public API consolidated under com.osohq.oso_cloud package
- Explicit wildcard behavior with ValuePattern types
- New QueryBuilder API with fluent interface
- Enhanced type safety with FactPattern
Breaking Changes
- Packages & Imports
- Batch Operations
- Query API
New Features
- QueryBuilder API
- Value Patterns
Migration Testing
After completing your migration:- Run your existing tests to ensure functionality is preserved
- Test edge cases with wildcards and batch operations
- Verify performance with the new QueryBuilder API
- Check type safety if using TypeScript or other typed languages
- Update documentation to reflect new API patterns