Successfully updated @better-i18n/sdk to use the new dedicated Content API endpoint.
1. packages/sdk/src/client.ts
- const DEFAULT_API_BASE = "https://dash.better-i18n.com";
+ const DEFAULT_API_BASE = "https://content.better-i18n.com";2. packages/sdk/src/content-api.ts
- const base = `${apiBase}/api/v1/content/${org}/${project}`;
+ const base = `${apiBase}/v1/content/${org}/${project}`;3. .changeset/migrate-to-dedicated-api.md
- Created changeset for major version bump (v0.4.0 → v1.0.0)
- Comprehensive migration guide
- Backward compatibility notes
Current: @better-i18n/sdk@0.4.0
Next: @better-i18n/sdk@1.0.0 (major - breaking change)
Before:
https://dash.better-i18n.com/api/v1/content/{org}/{project}/models
After:
https://content.better-i18n.com/v1/content/{org}/{project}/models
- ✅ Users without custom
apiBase→ Automatically use new endpoint ⚠️ Users with customapiBase→ Need to update to new URL- ✅ Old endpoint remains operational during transition
- CORS Fixed - Wildcard origin for public access
- Better Performance - CDN caching (60s + 1h stale-while-revalidate)
- Clean URLs - Professional API domain
- Independent Scaling - Dedicated infrastructure
cd ../better-i18n-oss
# Version and publish
bunx changeset version # Updates version to 1.0.0
bun install # Update lockfile
git add .
git commit -m "chore: release @better-i18n/sdk@1.0.0"
bunx changeset publish # Publish to npm
git push --follow-tags- Update SDK docs with new endpoint
- Add migration guide to docs
- Update examples and code samples
- Announce v1.0.0 release
- Share migration guide
- Set deprecation timeline for old endpoint
Most users don't specify apiBase, so they'll automatically use the new endpoint:
// Just update to v1.0.0 - no code changes needed
const client = createClient({
project: "acme/web-app",
apiKey: "bi18n_...",
});If you've customized the API base URL:
// Update from:
const client = createClient({
project: "acme/web-app",
apiKey: "bi18n_...",
apiBase: "https://dash.better-i18n.com", // Old
});
// To:
const client = createClient({
project: "acme/web-app",
apiKey: "bi18n_...",
apiBase: "https://content.better-i18n.com", // New
});If you need to stay on the old endpoint temporarily:
// Pin to v0.4.0 in package.json
{
"dependencies": {
"@better-i18n/sdk": "0.4.0"
}
}
// Or override apiBase
const client = createClient({
project: "acme/web-app",
apiKey: "bi18n_...",
apiBase: "https://dash.better-i18n.com",
});✅ bun run typecheck - PASSED- 2 files modified (client.ts, content-api.ts)
- 1 changeset created (major version bump)
- 4 lines changed total
- Zero breaking API changes (only endpoint URL)
| SDK Version | API Endpoint | CORS | Cache | Status |
|---|---|---|---|---|
| v0.4.0 | dash.better-i18n.com/api/v1/content | ❌ | ❌ | Old |
| v1.0.0 | content.better-i18n.com/v1/content | ✅ | ✅ | New |
Week 1-2 (Current):
- ✅ Deploy new Content API worker
- ✅ Update SDK to v1.0.0
- ✅ Publish to npm
Week 3-4:
- Monitor adoption
- Track error rates
- Gather feedback
Month 2-3:
- Add deprecation warning to old endpoint
- Email remaining users on old endpoint
Month 4:
- Redirect old → new (301)
- Remove old REST routes
- ✅ SDK Updated: Default endpoint changed
- ✅ Type Safety: Zero type errors
- ✅ Changeset Created: Semantic versioning
- ✅ Migration Guide: Comprehensive documentation
- ✅ Backward Compatible: Old endpoint still works
SDK successfully migrated to the new dedicated Content API. Version bump to v1.0.0 reflects the breaking change in default endpoint. Users can upgrade seamlessly with automatic endpoint migration.
Ready for npm publish! 🚀