Skip to main content

This upgrade is required. The endpoints Web SDK 2.x uses now answer 426 Upgrade Required. Sites running 2.x keep showing what they cached but receive no further updates until you deploy 3.0.1 or later.

1. Update the package

2. Use a Client Token

Pass your App’s Client Token (sb_...) as apiToken. Create one in the dashboard (see API Tokens). The token now travels in the URL path, not in an X-API-Token or Authorization header. A Figma Plugin Token, or a revoked or expired token, gets 401 invalid_token.

3. Review the behaviour changes

initialize() resolves earlier

This is the change most likely to affect your code. With a Catalog stored from an earlier visit, initialize() now resolves as soon as that Catalog is applied; the /languages and version checks finish in the background. On a first visit it still waits for the download. If your code assumes “initialize() resolved” means “synced with the server”, wait for the start-up checks explicitly:
Errors found after start-up, such as a rejected token, arrive through onSyncError. In React, useStringBoot().error reports them too.

Other changes

Removed types

MetaResponse, DeltaResponse, CatalogResponse, ApiResponse, SyncMetadata, CachedString, FAQMetaResponse, FAQDeltaResponse and FAQCatalogResponse. Use Catalog, LanguagesResponse and CurrentVersionResponse instead.

What happens to returning visitors

On the first start, 3.0 deletes the data 2.x stored in the browser and downloads the strings once.

Checklist

  • @stringboot/web-sdk is 3.0.1 or later
  • apiToken is a Client Token starting with sb_
  • Code that needs fresh server data waits for waitForStartupSync()
  • Errors after start-up are handled with onSyncError (or useStringBoot().error)
  • Analytics code handles an empty assignments object
  • StringBoot.FAQ.initialize(...) calls are removed
  • A first visit shows your strings, and an edit in the dashboard appears within about two minutes